This exercise should take between 1 and 2 hours
The repository contains a VS solution (StreamingService.sln) containing 2 projects
- StreamingService
- StreamingService.Test
You'll notice that StreamingService is quite badly designed/written.
-
Implement UserService.GetUsersWithRemainingSongsThisMonth().
-
Review and re-write UserService, applying SOLID principles to the class(es) demonstrating:
- Understanding of the Single Responsibility principle
- Open Closed principle
- Liskov Substitution principle
- Interface Segregation principle
- Dependency Injection principle
- Improve the code with any other coding standard you feel is appropriate - please explain your approach. If you cannot do all of these please attempt the once you can and explain you understanding of the others.
-
Write unit tests to provide code coverage for the improved UserService class(es) to demonstrate the improve code works.
- If able, demonstrate you ability to mock dependencies
- Assert dependencies were correctly called
- Assert the results are as they should be
There isn’t a perfect or correct answer, and do not worry if you cannot get all the tests working. This exercise is designed to gauge your level of understanding and I am looking to see your approach.
Fork the solution, make your changes and email a link to lphillips@basemap.co.uk along with any commentary you wish to include.
If you feel it helpful, feel free to explain your reasoning in comments. You will not marked down for over commenting on this exercise.