This is another in Robert's Getting Started series, where he provides an introduction to a topic that everyone knows about but not everyone is actually doing (or doing enough of). In this episode, Robert wraps up his 3 part series on unit testing. He shows how to use Microsoft Fakes, which enable you to replace a method call with a stub or shim in your unit tests. For example, you can declare, for the purpose of running a unit test, that a call to a random number generator always return 6 or that a call to the Save method of a service always returns true. That way, you can test the rest of the code in that unit. Robert then shows how to configure continuous integration with Visual Studio Online. Once you do that, all of your unit tests will be run every time you check in code.
You can find the sample code and demo scripts for the entire 3 part series here.
Previously on Visual Studio Toolbox
Available formats for this video:
Actual format may change based on video formats available and browser capability.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.