This is My Side, That’s Your Side – Keeping Your Unit Tests Isolated with Mocks


An important goal of Test Driven Development (TDD) is to be able to isolate your code under test. This means the method and class you are testing at any given time should not interact with other classes or external resources like data stores or web services. So how do you test code the relies on these things? You use mock objects to stand in for them! This session will explain the basics of mocking including the different types of mocks (mocks, stubs, fakes, etc.). You will see how to use a mocking framework to make your test writing fast, easy and more dependable. You will also learn some good patterns for creating and using mocks and shown some anti-patterns to avoid. Lastly, you’ll be shown how to introduce mocking and unit testing into an environment that was not really designed for it.

James Bender

James is the Appication Development Practice Lead at ICC in Columbus, OH. James has worked as a developer and architect on everything from small, single-user applications to Enterprise-scale, multi-user systems. His specialties are .NET development and architecture, TDD, Web Development, JavaScript, cloud computing, and agile development methodologies. He is an experienced mentor and author. James is a Microsoft MVP and former President of the Central Ohio .NET Developers Group. James’s book “Professional Test Driven Development with C#: Developing Real World Applications with TDD” was released in May of 2011 and his new book “Developing SPAs: Working with Visual Studio 2015, AngualrJS and ASP.NET Web API” will be out in the first quarter of 2016. James’s Twitter ID is JamesBender