Domain Model Unit Test
Running a unit test should be consistent with its results that is it always returns the same result if you do not change anything in between runs.
Domain model unit test. The test should be able to automatically detect if it passed or failed without any human interaction. This is a term from the ddd community that does a better job of capturing our intended meaning see the next sidebar for more on ddd. Don t unit test dto s.
In the introduction we used the term business logic layer to describe the central layer of a three layered architecture. Don t try to automate or genericize your domain object tests. Domain testing is a software testing process in which the application is tested by giving a minimum number of inputs and evaluating its appropriate outputs.
Unit testing is done during the development coding phase of an application by the developers. The idea is pretty simple a way to easily test your domain classes. Other testing frameworks like dbunit and unitils can also be used to test domain layer.
Unit testing frameworks like junit or testng are great tools to implement and manage the domain model. The purpose is to validate that each unit of the software code performs as expected. Unit tests isolate a section of code and verify its correctness.
With nhibernate it is possible to build large systems whose domain model is easy to understand unit test and refactor. Unit testing is a type of software testing where individual units or components of a software are tested. Since csfbl will only run off an mssql database and the schema is constantly changing and the domain model has many foreign key dependencies unit testing against the database is important.
For the rest of the book we re going to use the term domain model instead. These are just simple data structures with a bunch of getters and setters and no behavior. Automatically unit test your model.