2
檢查時我有以下NUnit測試失敗:NUnit的Has.Member爲對象
PL.Web.MVC.Rules.Tests.ComplexRulesServiceTests.GetComplexRulesTestContents:
Expected: collection containing <PL.Web.MVC.Models.Rules.RuleViewModel>
But was: < <PL.Web.MVC.Models.Rules.RuleViewModel>, PL.Web.MVC.Models.Rules.RuleViewModel>, <PL.Web.MVC.Models.Rules.RuleViewModel> >
我從http://www.nunit.org/index.php?p=collectionConstraints&r=2.5.5嘗試了測試,他們全部通過。
這是什麼我做錯了?
感謝您的幫助提前!
謝謝jimmy_keen。爲了讓它在此期間工作,我重寫了自定義類中的默認相等比較,並檢查了使用Assert的array.Contains(var)。感謝您的澄清,我很好奇它是否在幕後做了一些「特殊」的事情。 – JGraves