locked
How to run N-Unit tests created in Visual studio using MS Test? RRS feed

  • Question

  • Basically I have created Unit tests and afterwards replaced attributes of class and test methods with N-unit Annotations like [Test Class] with [Test Fixtures] and [Test Method] with [Test] and I am able to run them successfully in Visual studio.But I am unable to run them using MS Test using command prompt by calling the relevant project dll file.Will MS test support to N-unit tests and if it supports, is there any change in calling N-unit tests?
    • Edited by Krishnabv Saturday, June 11, 2016 5:39 PM
    Saturday, June 11, 2016 3:19 PM

Answers

  • Hi Krishnabv,

    According to your description, I create a sample NUnit Test in my Visual Studio 2015 and run successful in Test Explorer.

    Then I try run this test with MSTest, it tell me no test to execute. And as far as I know, the MSTest.exe should be used to run unit test in Microsoft.VisualStudio.TestTools.UnitTesting framework.

    So if you want to run the NUnit Test with command, please use the nunit-console.exe which supports the NUnit Test framework. Please located the nunit-console.exe in path "C:\Users\user\.nuget\packages\NUnit.ConsoleRunner\3.2.1\tools". In my project, I'm using NUnit 3, so the console.exe is nunit3-console.exe. Following screenshot shows the NUnit test test result with nunit-console.exe.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Krishnabv Tuesday, June 14, 2016 9:12 PM
    Tuesday, June 14, 2016 7:30 AM

All replies

  • Hi Krishnabv,

    According to your description, I create a sample NUnit Test in my Visual Studio 2015 and run successful in Test Explorer.

    Then I try run this test with MSTest, it tell me no test to execute. And as far as I know, the MSTest.exe should be used to run unit test in Microsoft.VisualStudio.TestTools.UnitTesting framework.

    So if you want to run the NUnit Test with command, please use the nunit-console.exe which supports the NUnit Test framework. Please located the nunit-console.exe in path "C:\Users\user\.nuget\packages\NUnit.ConsoleRunner\3.2.1\tools". In my project, I'm using NUnit 3, so the console.exe is nunit3-console.exe. Following screenshot shows the NUnit test test result with nunit-console.exe.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Krishnabv Tuesday, June 14, 2016 9:12 PM
    Tuesday, June 14, 2016 7:30 AM
  • Thanks for the clarification and guidance on N-unit console.
    Tuesday, June 14, 2016 9:13 PM