Reputation: 4928
I'm working on a dotnet application and am trying the XUnit testing framework for the first time. I've been following the getting started tutorial.
I wrote my first tests and am now trying to run them. However, the tutorial says I must open up a console an enter some obscure command
packages\xunit.runner.console.2.2.0\tools\xunit.console MyFirstUnitTests\bin\Debug\MyFirstUnitTests.dll
This seems a little painful. Why must I open up a separate command prompt to test the code? Is it possible to run the tests directly within Visual Studio? And furthermore, this seems like an absolute mouthful to type and remember.
Upvotes: 3
Views: 6009
Reputation: 61795
The tutorial you reference is not VS-specific and is purposefully illustrating a) that you don't need an IDE and b) how to test from the commandline (some prefer this as a workflow in some cases)
See the Running tests with Visual Studio section in the getting started guide for Visual Studio
TL;DR To get VS to pick up the tests, you need to reference the xunit.runner.visualstudio
package to wire things up such that the tests get surfaced to the test discovery mechanism (this package also is the modern way in which CI configs tend to bind to test frameworks, rather than expecting you to wire up invocation of xuint.runner.console
)
Upvotes: 3