10 Reflection and mocks

This chapter covers

  • A refresher on using the repository/service pattern and views
  • Testing with mocks using the Moq library
  • Detecting coupling in multilayered testing architectures
  • Using preprocessor directives
  • Using reflection to retrieve assembly information at run time

In chapters 6 through 9, we implemented the repository layer of our FlyingDutchmanAirlinesNextGen project. In this chapter, we’ll refresh our knowledge of the repository/service pattern and implement (partially) two of the four following required service classes:

  • CustomerService (implemented in this chapter)

  • BookingService (implemented in this chapter and chapter 11)

  • AirportService (implemented in chapter 12)

  • FlightService (implemented in chapter ...

Get Code like a Pro in C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.