Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeLens only finds tests that are written in MSTests

I recently installed Visual Studio 2013 and CodeLens is amazing! The problem that I find is that whenever I open a class file that has methods in it, it doesn't seem to find the Unit Tests associated to the method if it is not written in MSTest. Is there anything that I have to do so that it can find other Unit tests like MSpec?

enter image description here

Is it because Machine Specifications has a different approach when creating unit tests vs MSTest or other testing framework out there?

like image 401
123 456 789 0 Avatar asked Oct 02 '22 15:10

123 456 789 0


1 Answers

The tested by and test status indicators are powered by the test explorer.

So if your MSpec tests show up in the test explorer and are written in C# or VB, they should also show up in CodeLens.

(same answer as Visual Studio 2013 feature Code Lens with NUnit)

I just did it with NUnit on a clean machine by installing Nunit and the Nunit extension in extension manager. Here Main shows one reference and one passing test, and the test itself shows the checkmark after successfully running.

enter image description here

like image 175
John Gardner Avatar answered Oct 07 '22 18:10

John Gardner