---
title: "NUnit vs. MsTest: NUnit wins for Unit Testing."
url: "https://osherove.com/blog/2010/3/5/nunit-vs-mstest-nunit-wins-for-unit-testing.md"
canonical: "https://osherove.com/blog/2010/3/5/nunit-vs-mstest-nunit-wins-for-unit-testing.html"
published: "2010-03-05T16:19:27"
updated: "2010-03-05T16:19:27"
tags: ["Unit Testing"]
author: "Roy Osherove"
description: "People are still wondering what are the differences between the two most popular unit testing frameworks in the .NET world: the open source NUnit and the commercial MsTest). Here’s a short list of what i remember…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# NUnit vs. MsTest: NUnit wins for Unit Testing.

By Roy Osherove March 5, 2010 In [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published March 5, 2010; technical details may be outdated.

[People are still wondering](http://stackoverflow.com/questions/1487773/is-there-anything-i-can-do-in-nunit-that-i-cant-do-in-mstest/) what are the differences between the two most popular unit testing frameworks in the .NET world: the open source NUnit and the commercial MsTest).

Here’s a short list of what i remember instantly:

- Nunit contains a \[TestCase\] attribute that allows implementing parametrized tests. this does not exist in msTest
- MsTest's ExpectedException attribute has a bug where the expected message is never really asserted even if it's wrong - the test will pass.
- Nunit has an Assert.Throws API to allow testing an exception on a specific line of code instead of the whole method (you can easily implement this one yourself though)
- Nunit contains a fluent version of Assert api (as already mentioned - Assert.That..)
- Nunit is much faster
- NUnit can run tests in 32 and 64 bit (MSTest only runs them in 32 bit IIRC)
- NUnit allows abstract classes to be test fixtures (so you can inherit test fixtures). MsTest does not.
- NUnit allows non public classes to be test fixtures (as of the latest version)
- NUnit was created SOLELY for the idea of unit testing. MsTest was created for Testing - and also a bit of unit testing.
- NUnit contains PNunit (running prallel tests with Nunit). MsTest only adds this ability in vs 2010

given all these – **MsTest has much better abilities for integration based testing** (all these are things Nunit doesn’t even want to have):

- ability to do data-driven tests from a db data source
- ability to do performance testing
- ability to determine the order of tests (ordered tests)
- ability to easily setup and teardown and generate database data
- great integration with team system reporting for LOADS of statistics

**having said all these:**

if you’re working with team system, I’d use MsTest. the integration with other team system tools and reporting is just beyond compare and the reporting alone helps alot to find recurring breaking tests, code churn vs. new tests and others.

## Lessons on this topic

- [Syntax](https://courses.osherove.com/courses/tdd-in-net-in-hebrew/syntax/) · TDD in .NET in Hebrew

## More in Unit Testing

[All posts in Unit Testing](https://osherove.com/blog/category/unit-testing)

- Mar 19, 2010

    ### [Code excavations, wishful invocations, perimeters and domain specific unit test frameworks](https://osherove.com/blog/2010/3/19/code-excavations-wishful-invocations-perimeters-and-domain-s.html)

- Mar 7, 2010

    ### [Introducing Typemock Test Lint](https://osherove.com/blog/2010/3/7/introducing-typemock-test-lint.html)

- Feb 13, 2010

    ### [Inhibiting design tooling and sex education](https://osherove.com/blog/2010/2/13/inhibiting-design-tooling-and-sex-education.html)

- Jan 12, 2010

    ### [Unit Testing Biztalk : Two possible frameworks](https://osherove.com/blog/2010/1/12/unit-testing-biztalk-two-possible-frameworks.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
