Azure DevOps, Scrum, & .NET Software Leadership and Consulting Services

Free course! Predicting the Future, Estimating, and Running Your Projects with Flow Metrics

Lab: Refactor for testability using the Repository pattern

I had a long drive yesterday to go visit a customer and while I was driving it occurred to me that I have LOTS of courseware that I’ve written that is just sitting around gathering virtual dust.  Whether they’re parts of classes that never fully came together or they’re for courses that target old versions of Visual Studio, the ideas are still useful and I’d rather share them out than have them just sit around. 

A couple of years ago I started working on a software architecture skills course and wrote a lab that walks you through how to refactor an application with tightly coupled data access logic to use the Repository pattern so that the code is more testable.  Here’s that lab.

The before and after code for this lab targets Visual Studio 2010 but you’re all a bunch of smartypantses so you probably won’t have too much trouble making it work with Visual Studio 2012.  The version of the tool is different but the ideas are still absolutely relevant. 

Here are the links to the materials:




— Want some software architecture training or guidance using Visual Studio 2012?  Can’t quite figure out how to unit test that application that you have?  We can help.  Drop us a line at


One response to “Lab: Refactor for testability using the Repository pattern”

  1. […] Lab: Refactor for testability using the Repository pattern Unit Testing & Test-Driven Development Courseware for Visual Studio 2010 By Ben Day On […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.