在Nunit,
之间有什么区别吗?Assert.AreEqual(IEnumerable<T>, IEnumerable<T>)
和
CollectionAssert.AreEqual(IEnumerable<T>, IEnumerable<T>)
答案 0 :(得分:2)
没有重载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);
}
}