Mocking Frameworks

NMock 2 vs Moq

You may remember from my previous blog post on mocking frameworks that I'm a bit of a fan of this kind of tool. They're great for simplifying unit testing, and can also help guide you in to writing better, more loosely-coupled code via Dependency Injection.

NMock Framework

To aid the testing of my personal finance program, I've been making heavy use of the NMock mocking framework for .NET. This is a cool utility that allows you replace actual code calls with mock code calls, factoring out a lot of complexity of setting up some tests. For example, I first started using it to mock the log4net logging framework rather than creating a new logger for each test/suite and passing that around.

Subscribe to RSS - Mocking Frameworks