This repo contains the code for my workshop Refactoring using Design Patterns
DPKata1 and DPKata2 contain an exercises for strategy design pattern
DPKataCORS contains an exercise for chain of responsability design pattern
Packages for NUnit are already installed
- Have a look in BeforeDP folder
- Run Tests from BeforeDP
- Extract empty classes instead of methods from Program.cs
- Add a strategy context
- Extract data needed for strategy context
- Set Strategy, use classes instead of the methods
- Adapt tests
- Add implementation from the methods to the corresponding classes
- Re-run adapted tests
For steps 3-8, the refactoring is in AfterDP folder
Sorting Strategies
Design a chain of responsibility for loggers It should be a separated logger for console, file and e-mail Warning & Error are logged in console Email logger and Console logger handle functional errors and functional messages
Console Logger logs everything E-mail logger functional errors File logger warning and error