这两者有什么区别吗?
最佳答案
没有区别。自 v2.5 起添加了 Assert.True()
和其他内容(不含 Is
)。
来自版本 2.5
的文档:( nunit v2.5 )
Two forms are provided for the True, False, Null and NotNull conditions. The "Is" forms are compatible with earlier versions of the NUnit framework, while those without "Is" are provided for compatibility with NUnitLite
顺便说一句,反汇编的nunit.framework.dll(使用ILSPY)
public static void IsTrue(bool condition)
{
Assert.That(condition, Is.True, null, null);
}
public static void True(bool condition)
{
Assert.That(condition, Is.True, null, null);
}
关于nunit - NUnit 中 Assert.True 和 Assert.IsTrue 之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12352448/