3. Trustworsy No logic in tests Test one thing Easy to run Assure code coverage 3
4. Maintenance 4 DRY Tests isolation One assert per test Avoid over specification Don’t call one test from another Keep track on shared state (singletons, DB, file system) AAA (Arrange, Act, Assert)
5. Some patterns Repository A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection. Client objects construct query specifications declaratively and submit them to Repository for satisfaction. Objects can be added to and removed from the Repository, as they can from a simple collection of objects. 5
6. Some patterns 6 DAO Access to data varies depending on the source of the data. Access to persistent storage, such as to a database, varies greatly depending on the type of storage and the vendor implementation.
7. DAO vs Repository DAO Repository 7 Full control over query Easy to use Unpredictable Easy to mock Generic Linq provider