We started by looking at why it is important for developers to write unit tests to develop quality-assured code. Theoretical problems were identified that could arise from bugs in the software. These include loss of life and expensive lawsuits. Unit testing and what makes a good unit test was then discussed. We identified that a good unit test must be atomic, deterministic, repeatable, and fast.
Next, we went on to look at the tools available to developers that assist with TDD and BDD. MSTest and NUnit were discussed with examples that showed how to implement TDD. Then, we looked at using a mocking framework called Moq in conjunction with NUnit for testing mock objects. Our look at tools then concluded with SpecFlow—a BDD tool that allows us to write features in a business language that both techies and non-techies can understand—to make sure that what the business wants is what the business gets.
NUnit was then put to work as we worked through...