Testing the service layer

This section covers the testing of the service layer part implemented previously. As we did in Chapter 8, Building the Data Access Layer, we need to set up a mock catalog context that provides the data necessary for testing the service classes. The Catalog.Infrastructure project already has its own implementation of the TestCatalogContext class and the ModelBuilderExtensions class. Furthermore, we can use the same two classes to implement the tests for the service layer. What we need is just a bit of refactoring and optimization on the Catalog.Infrastructure project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.255.127