在Nunit中,有什么区别
Assert.AreEqual(IEnumerable<T>, IEnumerable<T>)
和
CollectionAssert.AreEqual(IEnumerable<T>, IEnumerable<T>)
?
在Nunit中,有什么区别
Assert.AreEqual(IEnumerable<T>, IEnumerable<T>)
和
CollectionAssert.AreEqual(IEnumerable<T>, IEnumerable<T>)
?
没有超载Assert.AreEqual(IEnumerable<T>, IEnumerable<T>)
,只有Assert.AreEqual(object, object)
。至少对于nunit
2.5.10,它们的实现是相同的:
public class CollectionAssert
{
public static void AreEqual(IEnumerable expected, IEnumerable actual)
{
Assert.That((object) actual, (IResolveConstraint) new EqualConstraint((object) expected));
}
}
public class Assert
{
public static void AreEqual(object expected, object actual)
{
// EqualConstraint EqualTo(object expected)
Assert.That(actual, (IResolveConstraint) Is.EqualTo(expected), (string) null, (object[]) null);
}
}