Thanks to Visual Studio Fakes is it possible to isolate your unit test and testing difficult to test code. Today I need to test a class that issues some Web Request around the internet and I’m concerned about testing the SUT when the web response contains some specific code like 404 (Not Found) or something. [...]

Continue reading about Unit Test class that makes use of HttpWebRequest thanks to Visual Studio fakes library

In VS2012 we have support for basically any Unit Test Framework, because the new test runner is plugin based, and everyone can write plugin to make it compatible with the framework of choice. From the original version that was released with Visual Studio 2012 RTM, in Update 1 and Update 2 the test runner gained [...]

Continue reading about New Unit Test functionality in VS2012 Update 2: Test Playlist

I’ve already blogged previously about the new Shim Library of Visual Studio 2012 Using Shims in Visual Studio to test untestable code Shim and InstanceBehavior fallthrough to isolate part of the SUT. Now it is time to explore another scenario where shim can save your life. Suppose you are working with Hardware, Es. a barcode [...]

Continue reading about Shim constructors to isolate “Future Objects”

I’ve blogged in the past various solution to run NUnit tests during a TFS build, and now it is time to make it again for TFS11, but this time it is incredibly simple, because the new Test Runner supports multiple frameworks, so it works almost automatically. You can read from Peter Provost blog that actually [...]

Continue reading about Running NUnit and xUnit tests in TFS11 build

If you read my last post, I explain how I solved a really stupid problem of managing a Traffic Light using OOP principles and the concept of Domain Events, now I want to emphasize some of the advantages you have using this approach. One benefit is in unit testing, suppose you want to test that [...]

Continue reading about Advantage of DDD approach to problem