Skip to content

John Hancock - RestaurantReviews implementation#48

Open
hancock309 wants to merge 12 commits intoSoftWriters:masterfrom
hancock309:master
Open

John Hancock - RestaurantReviews implementation#48
hancock309 wants to merge 12 commits intoSoftWriters:masterfrom
hancock309:master

Conversation

@hancock309
Copy link

This is not a complete implementation. I wanted to focus on demonstrating SOLID principals and writing code that is easy to test.

The projects are as follows:

  • RestaurantReviews.API
    • Main API entrypoint
    • Contains controllers for restaurant, review, and user
      • controllers only contain endpoints that were requested or that I needed to test
    • Dependency Injection setup is in Startup.cs
    • Contains json data for testing
  • RestaurantReviews.API.Tests
    • Contains unit tests for one controller and one model validator
    • Uses XUnit and Moq
  • RestaurantReviews.Business
    • Contains managers for restaurant, review, and user
      • Some input validation is done, but is definitely incomplete
        • Example: does not test to see if a user is submitting a duplicate review
    • Contains a Fluent model validator for reviews
      • Checks for empty review content, invalid restaurantId, and invalid userId
  • RestaurantReviews.Interfaces
    • Contains all of the interfaces
  • RestaurantReviews.JsonData
    • Concrete implementations of the repository interfaces
    • Not unit tested because this is only meant to demonstrate that the rest of the code works
  • RestaurantReviews.Models
    • Concrete implementations of the model interfaces
    • Models were kept as simple as possible

Notes:

  • I did not implement anything as async
  • I did not do much error handling

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant