NUnit & Visual Studio Unit Testing Framework

Is there a way to create unit tests that can be run using the Visual Studio Unit Testing Framework , as well as NUnit ? I personally prefer Visual Studio alone, but the build server I use is only NUnit, so I would like to support both options if possible.

EDIT: To clarify, I would like to run my own tests using Visual Studio (without add-ons or extensions), but other colleagues would like to use NUnit, and the build server needs NUnit. I canโ€™t change anything except the code, so I thought that there would be an easy way to satisfy everyone, but it looks a little more complicated :)

+3
source share
4 answers

Sounds like you need a Visual Studio test runner. If you install Gallio , it will use the VS test runner to run any unit tests (xUnit, nUnit, MBUnit). Also Resharper and CodeRush have their own test rollers.

+2
source

Here is one way to do this using the directives and aliases of the precompiler using the keyword "using"

+1
source

JustCode unit test, , xUnit, NUnit, MbUnit Visual Studio Unit Testing Framework.

0

You can write frame agnostic statements using a library called Should. It also has a very nice smooth syntax that you can use if you like smooth interfaces. I had a blog post related to the same.

http://nileshgule.blogspot.com/2010/11/use-should-assertion-library-to-write.html

0
source

Source: https://habr.com/ru/post/1767108/


All Articles