Is there anything I can do in NUnit that I can't do in MSTest?

后端 未结 12 1477
南笙
南笙 2020-12-23 20:10

This question has been asked in various forms in a number of different forums, but, IMHO, I haven\'t been able to find a place where it\'s really answered clearly, so I\'m g

12条回答
  •  情书的邮戳
    2020-12-23 21:07

    I have a nice way in between MsTest and NUnit. You can use the MSTest framework to run your test (TestClass attribute and TestMethod attribute for each test) but use the NUnit Assert API.

    just do this :

    using Microsoft.VisualStudio.TestTools.UnitTesting; 
    using Assert = NUnit.Framework.Assert;  
    

    now you can use Assert.That(..) and still have TFS automated build and test report. your test can be run in VS, TestDriven.net or Resharper, it doesnt matter, the test will fail or pass correctly, and the fail output will be according to NUnit framework.

    see here : http://alsagile.com/archive/2010/03/09/stop-the-war-between-nunit-and-mstest-make-them.aspx

提交回复
热议问题