N-Tiered example

Now, turn your attention back to the API controller in  Chapter 6,Setting Up the .NET Test Environment. Hard-coded data being returned directly from the controller does not make for a solid foundation on which to build an application. Most modern .NET applications of any size are written in some sort of N-tiered architecture. You'll want to separate your business logic from your presentation, in this instance, the presentation in the API endpoint.

We'll introduce an interface for a speaker service in preparation for using Dependency Injection to provide the concrete implementation to the controller, then verify that the proper method in the new service is being called. You'll need to rearrange some tests in order to remove the business logic from the controller.

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

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