1

I have created SpecFlow unit tests, I need to associate my tests to MTM test cases from visual studio. I am using Nunit as a test provider instead of MsTest. I can see my Nunit tests in test explorer, but while trying to associate unit tests to test cases, the list to choose tests from is empty.

1) Do my test provider should be only MsTest to do linkage. 2) During time of linkage, can I change my test provider to MsTest, do the association, and again change my test provider to NUnit.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ankit
  • 169
  • 1
  • 4
  • 16

2 Answers2

1

It seems that what you want is not possible. A similar question has been asked on stackoverflow here and the only answer says its not possible.

Someone also asked on the MSDN forums and the response from there seems to be the same, that it is only possible with MSTest

Community
  • 1
  • 1
Sam Holder
  • 32,535
  • 13
  • 101
  • 181
  • Thanks @SamHolder. what about second thing? has anyone tried this and got success? – Ankit Nov 11 '14 at 09:45
  • @Ankit I have no idea. Why not try it and post the results here? – Sam Holder Nov 11 '14 at 09:48
  • 1
    no its not possible, if we use MsTest during linkage and then change the test provider to NUnit, and if we run the test case from MTM, it gets failed with the error that 'Associated test is not found in dll'. Nevermind we are using only MsTest now. – Ankit Nov 20 '14 at 05:55
  • You could associate NUnit test with test cases using tfs api, but as mentioned MTM run test functionality wouldn't work You could write your own testrunner using tcm run /create or vstest/nunit console Or may be you could use this test runner in a vnext build step "Run Functional Tests" (since TFS 2015 Update 3), but you wouldn't be able to run individual tests You could create a tag-related query-based suite and run only tagged tests, this way you could select the tests you want, use your own test runner and have a proper result in your test case. But I haven't tried this yet. – MushyPeas Nov 23 '16 at 14:34
1

I know this question is from a few years ago but this is finally available in Visual Studio 2017 15.7.1. You can now associate NUnit and xUnit unit tests from the Test Explorer in Visual Studio. Here is some additional information on this and running the tests from a build or release. http://www.deliveron.com/blog/test-case-association-xunit-nunit-and-mstestv2-tests-available-visual-studio-2017-1571/

MikeDouglasDev
  • 1,331
  • 10
  • 22