Unit testing helps developers to test their code written whether it meets design & requirements and behaves as expected before delivering to QA testing. This will help to identify problems at early stages of the development even though it can’t be replaced with integration testing & performance testing.
There are many unit testing frameworks available in the industry. To decide on which one to go for will always be a challenge and we need to choose the right one for our applications. Rewriting the unit test code again later in the lifecycle of the project will become costlier. Decision is a purely personal preference that is best suited for your application/project needs. Listed some of the tools for C# with pros & cons to compare and decide on which one to use for your applications.
| Tool | Description | Pros | Cons |
| CSUnit | XUnit based framework which supports all .NET languages and integrated with Resharper |
. Easy to use GUI
. Search capabilities across test, output & statistics
. Rich set of attributes & assertions
|
. No autogeneration of test code
|
| NUnit | xUnit based framework and supports all .NET languages. One of the popular & reliable tools. This is integrated with Resharper |
. Independent test runner
.Open Source
. Integration with 3rd Party tools for continuous Integration( Jenkins etc)
. Reliable tool
. Asynchronous execution
|
. Not tightly integrated with Visual Studio
|
| MSTest | Command-line visual studio unit framework for executing visual studio generated unit tests | . Integrates with Visual Studio
|
. Slower
|
| XUnit.Net | Free and community-based .NET unit testing tool | . Freshly written framework for the evolved .NET platform
|
. Lack of documentation
|
Nilesh JadavPosted Sep 19, 2015, 1:33 AM
Nice Share !!
Former memberPosted Sep 18, 2015, 3:33 PM
Which one developer use mostly in this industry?
Mohammed IbrahimPosted Sep 18, 2015, 1:01 PM
nice
Shakti SaxenaPosted Sep 18, 2015, 8:15 AM
Good one
Sibeesh VenuPosted Sep 18, 2015, 7:18 AM
Nice Share.
Santhakumar MunuswamyPosted Sep 18, 2015, 6:45 AM
Nice Article
Sujeet SumanPosted Sep 18, 2015, 1:35 AM
Nice Article................
Harshad PansuriyaPosted Sep 18, 2015, 12:06 AM
Nice one
Karthikeyan KPosted Sep 17, 2015, 11:22 PM
Thanks for sharing