Visual Studio 2013 feature Code Lens with NUnit

走远了吗. 提交于 2019-12-23 09:39:10

问题


In the new Visual Studio 2013 there is a nice new feature called Code Lens (I think that it is only in the Ultimate version). Regarding methods, besides it shows references (how many and where) it also shows some information about versioning when working in team and tests statistics so that you know how many tests using the method are passing and how many failing.

I assume that this works perfectly with test projects embedded in Visual Studio, but does it work with NUnit? We are using NUnit for unit testing and we are trying to decide whether or not to move to VS2013 and one of reasons would be this new feature that we would sure like to use to its full extent if it support NUnit.

Do you have any experience with it?


回答1:


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

So if your NUnit tests show up in the test explorer, they should also show up in CodeLens.




回答2:


I don't have enough reputation points to add as a comment to John Gardner's reply, so I adding a new answer.

I added an answer to a similar question here - CodeLens only finds tests that are written in MSTests

Summary of that answer - you need to create a new Unit Test Project and add a reference to NUnit to that new Unit Test Project. That is how I got it to work with VS2013 and NUnit (along with the NUnit Test Provider) so now the tests show up in VS2013 Test Explorer window and in CodeLens.



来源:https://stackoverflow.com/questions/19725751/visual-studio-2013-feature-code-lens-with-nunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!