Nunit3如何从Nunit2重写代码

时间:2016-11-06 12:56:00

标签: c# nunit nunit-3.0

在nunit2中我使用了这段代码:

 yield return new TestCaseData(sourceWordsModelEmpty, combinationsModelEmpty).SetName("FindCombinationsTest - Empty").Throws(typeof(Exception));

如何在Nuni3中使用它?

1 个答案:

答案 0 :(得分:0)

我认为您在使用Throws时遇到问题。删除它并将异常类型作为附加参数传递。然后在测试中,将引发异常的代码包装在Assert.Throws中。