Struggling a little, but at the end I will evaluate line per line and showing the result of the line as beginning of the next line
Ok, I think I can now create a few test to see if the system will grab the right input and will also use the currentValue correctly
the input selection seems ok!
Added the execution of the operations the the previously insterted switch case. LEt's perform the test for these as well
forgot to add the variable to get the return from the function
Operator need to be reset to null everytime we perform the operation
Test ok! I also added a few tests without implementing the feature.(as from spec)
Modifiers added, and now the tests previously inserted are giving an "ok" result :D
To set the currentValue to null when we receive a "q" is not a good idea, better create a boolean and still return the remainder.
There was a bug, the FractionCalculator object needs to be instantiated outside the while.
Added test for absolute and clear.
I commented out all the Tests that give a purposefully "not ok" result.
Also, I've added a reset when the user enters a not valid input.
Added the handling of the invalid input.
Added one test for that.
Bug fixing.
- When there are two consecutive operators, the reset wasn't setting up the operator to null.
- lcd wasn't the correct name, lcm is correct.
- a negative denominator was giving an error of "Denominator is 0". Since to write 1/-3 is the same of writing -1/3, I added code to put all the negative fractions in this form.