Now that you know what test-first means and how you can build a
testable architecture, you are ready to start writing some real
unit tests. This chapter will explain what kind of assertions
you have, how a good unit test is set up and more. Mocks vs.
Stubs Before I start explaining how to build a unit test, I will
first briefly describe what mocks and stubs are. Mock objects
and stub objects are both 'fake' objects. This means that we can
just 'mock' an object (our repository for example), creating a
fake implementation of that object, that does nothing. This is
useful because we now no longer have to query against the
database, we just query against our fake object that says "al
right, I received some data from the database, here you have
it". The difference between mocks and stubs is that mock objects
can let your tests fail. A mock repository allows us to validate
that our repository's 'Add' method was called, raising an
exception if it wasn't called. Or we could validate that our
methods were called in a