Consumes a JSON webservice and displays the cats according to the gender of their owner
- Each class is responsible for a single piece of functionality all the way down to it's methods and variables
- Most classes are marked as internal so they cannot be used outside the library. The interfaces are left open so that they can be implemented in a different way if required. Good example is the
IOwnerSorter
interface. - As all classes are constructed using interfaces the Liskov's substitution principle can be exercised if required
- I have an interface for each functionality rather than one interface which does it all
- Dependency injection is implemented using the Autofac dependency container allowing flexibility to plug and play different implementations if required
- Logging is done to a file using SeriLog (very nice and simple)
- Console logging is commented out to emphasize the output of the application
- An
AppSettings.json
file is provided to configure the endpoints and logging levels as required during runtime
- Implemented using XUnit
- Interfaces mocked using Moq and AutoMoq
- Assertions done using FluentAssertions
- Unit tests are placed in files matching the files they are testing in the same folder structure as the project they are testing
- Unit tests are named exactly as their classes except with underscore and all lower case (this is intentional as it allows for quick searching with tools like Resharper, debateable :)