MVC Storefront, Part 2: Repository Pattern
In this installment, I walk through our Repository implementation and write out the first main set of unit tests. I also structure up the initial service layer methods and interfaces.
Getting Off The Ground
Finally! I get to code something! Our first set of requirements are pretty simple - which is the way we want em since we're being Agile:
- Users can brows products by Category and SubCategory
- Clicking on a Product in the category list shows a Product detail
- The product must display culture-specific pricing/descriptions as well as any discount information
- Each product can have 0 to many reviews.
I take a pretty good chunk out of the requirements in this session - working on the main setup of the Service layer as well as the Catalog Repository.
I also show you how you can work without a database (and keep working without one) as you test up and build your application from nothing. Ideally when working with TDD, you want to be sure that the your tests which require data are as isolated as possible. In other words - you don't want bad data to fail your tests.
by Rob Conery