Test-Driving ASP.NET MVC3 - Part 2

To view this screencast, add it to your cart and checkout. You can buy this screencast for any price, including FREE!

Click here to see the series overview

After recording Part 1, I tried to dive right into an episode about testing models but I found myself doing lots of clean-up. So I decided to stop and record an episode just to clean up our code!

TDD MVC - Part 2

In this episode, we:


Disclaimer

When we setup our DbContext, we don’t use Dependency Injection! Oh noes!

Feel free to use your favorite DI library (as I point out in the screencast). The important thing is: you’re eventually going to want to be able to override your context from your tests so you can make your tests run transactionally (which we’ll cover in a future episode).

That said, you don’t have to use DI (just because the cool kids are doing it). I don’t use DI in my personal apps so don’t feel bullied into using it, if you don’t feel like you actually need it :)

Resources