Sean M. Severson
Sean M. Severson

Reputation: 19

Stop unit tests from running

I would like to prevent all subsequent unit tests from running when certain conditions are met in a unit test. Is this possible in Visual Studio 2005?

Upvotes: 0

Views: 479

Answers (2)

womp
womp

Reputation: 116977

This doesn't sound good to me. Unit tests should not have any reliance on ordering.

If you're just trying to save time during a build, consider factoring out the conditional tests into their own assembly and using a build script to determine whether the second set of tests should be run.

Upvotes: 1

Paddyslacker
Paddyslacker

Reputation: 1880

This sounds like a code smell. You should set up your unit tests so that they are independent of one another, so that one failing test has no implications on any other tests. It sounds like you are doing something other than true unit testing at the moment.

Upvotes: 1

Related Questions