Run specific unit test in Visual Studio

前端 未结 5 1208
误落风尘
误落风尘 2021-02-11 11:58

I have dozens of unit tests, and I\'d like to fix the code I am working on now, but every time I run the tests it takes over 30 seconds to run every unit test (I think reflectio

5条回答
  •  伪装坚强ぢ
    2021-02-11 12:54

    Resharper and Test Driven .Net both have this feature in their visual studio test-runners. There may well be other VS plugins too.

    According to this answer (By Jon Skeet no less) it is possible in Visual studio natively too. To debug a single test:

    Click on a test method name, then press Ctrl+R, Ctrl+T. (Or go to Test / Debug / Tests in Current Context.)

    EDIT: (based on a comment from Justin R below) to run a test (as opposed to debugging it) the command is simply:

    Ctrl+R, T

提交回复
热议问题