In this series we look at the basics of integrating unit testing into your development process. We begin by talking about the purpose of unit testing, the frameworks available, setting up solutions to contain unit testing projects featuring MSTest and NUnit, demonstrate how to write effective unit tests and demonstrate the use of the Moq framework to mock up software layers outside the scope of your unit tests.
This series is organized into 3 days’ worth of material:
In this brief introduction to the series we talk about the purpose and the process of unit testing.
This video provides an overview to the various frameworks that are available, most notably MSTest and NUnit, but also provides a short list of other up-and-coming frameworks that are gaining momentum.
This video demonstrates how to set up a solution containing an MSTest project, how to use the Visual Studio IDE to run the tests and view the results, and how to add attributes to classes and methods that will be used in a unit test.
A popular alternative by the “father of unit testing” Kent Beck, this open source framework has grown to prominence because of its continual evolution and growing utility. This video demonstrates how to install, create a new unit test project in a solution, how to add the correct external dependencies and ultimately write and execute unit tests with NUnit.
Watch as we demonstrate the basics of Unit Testing and explain the thought process behind what we are doing and why we’re doing it.
To keep your unit tests pure, focused on testing business logic, it becomes necessary to write fake, or mocked, objects. This video demonstrates this technique.
Video discusses the Moq framework used to isolate (and “mock”) objects that are required for unit testing but would deliver inconsistent results if you simply called as is (ex. database, other external connection or resource).