Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any "advanced" testing framework for .NET?

I am looking for a testing framework that allows me to have:

  1. Different kinds(categories) of tests. I want to be able to just run all "fast" tests or all "slow" tests. I know MSTest allows you to create lists and run then run them, but I find it annoying and distracting. I'd like to just tag the tests with attributes as I am developing them, and then just have something like a combobox that let's me select which kind of tests I wanna run. I also know that if I have slower tests I can sort them with MSTest so I can see when the faster ones are over. That certainly is only a "hack" and as you have more and more tests, it gets a total mess.
  2. Run tests sequentially. When I say sequentially I don't mean that they depend on each other, I just mean that as I have to test the GUI I can't have 2 tests running at the same time.
  3. Have the option to have several tests depend on each other. This means that if I have a test A that fails, in some situations, I'd like to not even try to run tests B or C.
  4. Have some kind of support in Visual Studio for all of this. I currently am always doing CTRL+B/CTRL+R, A (build / run tests). So having to go and look to another app (even if its launched from VS IDE) each 2 minutes doesn't sound like a good solution.

Is there anything that is able to accomplish this? I find it awkward that with all this trend around testing and tdd, the tools at our disposal are still so primitive and raw.

like image 859
devoured elysium Avatar asked Dec 28 '22 08:12

devoured elysium


2 Answers

MbUnit

  • Categories: you have the [Category] attribute
  • Sequentially: most test runners do that by default.
  • Test dependencies: you have the [DependsOn] attribute
  • VS support: through Gallio, TestDriven.Net or ReSharper.
like image 142
Mauricio Scheffer Avatar answered Dec 30 '22 22:12

Mauricio Scheffer


VS's unit testing does 1, 2 and 4.

Different kinds(categories) of tests.

You can create multiple test lists by adding multiple "test settings" items, each can run different configurations or a different subset of your tests.

Run tests sequentially.

YOU Can control the level of concurrency used, including setting it to 1. (This does require editing an XML file, but is covered on MSDN).

Have some kind of support in Visual Studio for all of this. I

That's the easy one.

Have the option to have several tests depend on each other.

That's the hard one, as TDD best practice is for tests to be independent tools seem to assume this.

Within one class of tests keep flags and immediately exit tests where conditions have not been met.

like image 41
Richard Avatar answered Dec 30 '22 20:12

Richard