---
title: "Test Review #2 – ASP.NET MVC Unit Tests"
url: "https://osherove.com/blog/2009/3/21/test-review-2-aspnet-mvc-unit-tests.md"
canonical: "https://osherove.com/blog/2009/3/21/test-review-2-aspnet-mvc-unit-tests.html"
published: "2009-03-21T21:42:38"
updated: "2009-03-21T21:42:38"
tags: [".NET", ".Net 2.0", ".Net Original", "Agile", "Art Of Unit Testing", "TestReview", "Testing Guidelines", "Unit Testing"]
author: "Roy Osherove"
description: "See other reviews: Review #1: NerdDinner Here’s the second video review of Unit Tests. This is another one written by Microsoft – ASP.NET MVC ( source ). First, it’s important to state how surprised I was by the high…"
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/"
---

# Test Review \#2 – ASP.NET MVC Unit Tests

By Roy Osherove March 21, 2009 In [.NET](https://osherove.com/blog/category/net), [.Net 2.0](https://osherove.com/blog/category/net-2-0), [.Net Original](https://osherove.com/blog/category/net-original), [Agile](https://osherove.com/blog/category/agile), [Art Of Unit Testing](https://osherove.com/blog/category/art-of-unit-testing), [TestReview](https://osherove.com/blog/category/testreview), [Testing Guidelines](https://osherove.com/blog/category/testing-guidelines), [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published March 21, 2009; technical details may be outdated.

See other reviews:

- [Review #1: NerdDinner](http://weblogs.asp.net/rosherove/archive/2009/03/20/test-review-1-nerddinner.aspx)

Here’s the second video review of Unit Tests. This is another one written by Microsoft – [ASP.NET MVC](http://www.codeplex.com/aspnet) ([source](http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471)).

First, it’s important to state how surprised I was by the **high quality** of the tests in MVC. The tests are **readable, maintainable and trustworthy,** with very little issues that I could find. whatever Issues I found are rather easy to fix. In any case, if one is looking for examples of systems written in what seems almost entirely in TDD, or at the minimum with very good testing guidance, ASP.NET MVC should be a good stop to look at.

[see the video here](https://osherove.com/videos/2009/8/25/test-review-2-aspnet-mvc.html)

Issues discussed in this video:

- Implementing RowTest with MSTest, and the importance of naming (14:00)
- Verify() that is splitted from the mock expectations (17:00)
- some naming conventions
- Over-specification in tests (mainly more than one mock object per test)
- verifying mocks when it’s not required
- logic inside tests (concatenation)
- test factory methods with too much logic
- a very good example of when **multiple asserts** is really bad (11:50)

Again – I’m very pleased with the test quality. Now is the time to make sure the things above are fixed. they are still important!

## Lessons on this topic

- [Best Practices Continued](https://courses.osherove.com/courses/tdd-in-net-in-hebrew/best-practices-continued/) · TDD in .NET in Hebrew
- [Test Review Practices](https://courses.osherove.com/courses/the-art-of-unit-testing-and-tdd-master-class-in-net/test-review-practices/) · The Art of Unit Testing & TDD Master Class in .NET
- [Maintainability Practices](https://courses.osherove.com/courses/tdd-in-net-in-hebrew/maintainability-practices/) · TDD in .NET in Hebrew

## More in .NET

[All posts in .NET](https://osherove.com/blog/category/net)

- Mar 24, 2009

    ### [Geeky T-Shirt ideas](https://osherove.com/blog/2009/3/24/geeky-t-shirt-ideas.html)

- Mar 22, 2009

    ### [Test Review #3 – Unity](https://osherove.com/blog/2009/3/23/test-review-3-unity.html)

- Mar 20, 2009

    ### [Test Review #1 - NerdDinner](https://osherove.com/blog/2009/3/20/test-review-1-nerddinner.html)

- Mar 17, 2009

    ### [ALT.NET Israel – Meeting II 2d and 3rd of April](https://osherove.com/blog/2009/3/17/altnet-israel-meeting-ii-2d-and-3rd-of-april.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/
