O'Reilly logo

Software Testing using Visual Studio 2012 by Satheesh Kumar. N, Subashni. S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit Testing using Fakes

Microsoft Fakes, which requires Visual Studio 2012 Premium, is a fully featured mocking framework used for isolating the code under test by replacing the other parts of the application with Stubs and Shims. This is very useful in testing only the small portion of the code under test without worrying about the other parts of the application or component even if it fails. The Microsoft Fakes can Shim any .NET method, including non-virtual and static methods in sealed types.

Stubs

The Stub type makes it easy to test code that consumes interfaces or non-sealed classes with overridable methods. The default behavior can be dynamically customized for each member by attaching a delegate to a corresponding property of a Stub.

To use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required