Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 1.16 KB

File metadata and controls

34 lines (19 loc) · 1.16 KB

Windesheim_WriteTestableCode

A sample application where I've written some flawed code that will be refactored into testable and more maintainable code

The idea of the application is that someone can order hardware for employees and receive the invoice via email.

We are going to make this code testable by applying the SOLID Princples.

Build, Run & Test

Type in the terminal:

  • dotnet build
  • dotnet test
    • Run specific test class: dotnet test --filter <classname> eg. dotnet test --filter OrderModule1Tests
  • dotnet run --project WriteTestableCode

Structure

We have one solution with two projects:

WriteTestableCode

This contains the example code with the SOLID violations. I've divided this in separate folders:

1. Start: We have one class containing all SOLID violations.

Solutions: Contains every principle applied seperately in their own folders.

WriteTestableCode.Test

We have one test class in the 1. Start folder. Here you can write your own tests while trying to make the OrderModule testable. You can look at tests in the Solutions folder when you get stuck or need some inspiration.