NUnit支持的断言 |
|
断言真伪 |
Assert.That(condition, Is.True); |
断言比较关系 |
Assert.That(actual, Is[.Not].EqualTo(expected)); |
断言对象关系 |
Assert.That(obj, Is[.Not].Null); |
断言容器关系 |
Assert.That(container, Is[.Not].Empty); |
断言字符串关系 |
Assert.That(actual, Is[.Not].EqualTo(expected)[.IgnoreCase]); |
断言异常 |
Assert.That(() => { statements }, Throws.Exception.TypeOf<exception_ctor>()); |
RhinoMocks用于动态stub生成 |
|
准备工作 |
using NUnit.Framework; |
指定返回值 |
// We don't care about the passed-in arguments for CollaboratorService::methodName(). |
指定抛出异常 |
// We don't care about the passed-in arguments for CollaboratorService::methodName(). |