本文介绍了断言.MSTEST中存在多个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 在Nunit中我们有Assert.Multiple,如下所示,同样我们在mstest中有任何多个断言In Nunit we have Assert.Multiple , as shown below , Similarly do we have any multiple asserts in mstest 有时,需要继续并累积任何其他故障,以便它们可以立即修复。 Assert.Multiple(()=> { ; Assert.AreEqual(1,1," 1"); Assert.AreEqual(2 ,2," 2");& Assert.AreEqual(3,3," 3"); Assert.Multiple(() => { Assert.AreEqual(1, 1, "1"); Assert.AreEqual(2, 2, "2"); Assert.AreEqual(3, 3, "3");}); charantej charantej推荐答案 您好charantej,Hi charantej, mstest中没有 Assert.Multiple()。 There is no Assert.Multiple() in mstest. 参考链接: https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.assert.aspx?f=255&MSPPError= -2147217396 单个单元测试中的多个断言似乎不推荐:And Multiple assertions in single unit test seems not recommended: http://stackoverflow.com/questions/ 2430429 / are-multiple-asserts-bad-in-a-unit-test-even-if-chaining 祝你好运, Fletch 这篇关于断言.MSTEST中存在多个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-27 06:21