Calculator Refactor


You are given a calculator application. However, the solution is not perfect. All logic sits in “action scripts” behind button clicks, there are no test and it does not always handle operations correctly. E.g 1++2 equals 3 instead of “Error”

The code for this kata can be found at https://github.com/TDD Buddy/Wpf-Calculator-Kata

Your job is to write tests for the code, refactoring the code to create testable units pulling code left behind button clicks into something structured.

  • Keep your check-ins small by limiting each one to a single refactoring.
  • Should you find any bugs, fix them as you go by creating a failing test and then making it pass; then return to refactoring.

Bonus

Try and avoid the use of if or switch statements in your final solution