问题
My Reference is this http://msdn.microsoft.com/de-de/library/ms182532.aspx
Using Visual Studio. Lets say there is a Solution Project.SuperApp with some projects and one unit test project. If i want to run the tests i first have to build the solution and then run all tests from the Test-Explorer. Even if one test fails the software is already build and ready to deploy. Which seems like an error to me.
With other tools like Maven if you want to build/package a software component the tests are executed first. If one test fails the software component is not build/packaged even if it compiles.
How to tell Visual Studio to execute the test cases first and fail the build if one test case fails?
Thanks in advance
回答1:
From within TFS you can configure it to fail on the tests failing by following these steps:
- Edit the 'build definition'
- Select Process
- Under 2. Basic > Authomated Tests > Select the test assembly and you will see 'Fail Build On Test Failure. Set that to true.
来源:https://stackoverflow.com/questions/20045028/how-to-fail-build-if-test-method-fails