Closed iliantrifonov closed 7 years ago
Split up your unit tests better. If a method has "And" in its name, it is not testing a single thing.
For unit tests we can allow a single "And" on rare occasions, but most unit tests need to test only a single thing.
Fix the following:
In the main method of AddAndSubtract you are not taking input from the console.
Do not use shortened names (like "calc"). This makes the code less readable.
In PerformCalculation do not use the console, throw an exception instead, and catch it in the main program to display it to the user. The AddSubtractCalculator should not know about the Console.
Create unit tests the way we discussed yesterday, testing only a single functionality at a time. This way if one thing breaks, not all of your tests will get broken. It is important to have edge case tests to determine the cause of issues, not only long tests that test the general functionality.
Fix the failing unit tests
Read input in the form of a string from the console in the following format: 1+3-5+2=
The result should be the same as a calculator would provide. The end of your input will be the equals sign (=). The result will be the calculated number.
Create unit tests for the task.