Conversation
aleksandermilchev
left a comment
There was a problem hiding this comment.
Generally the basic cases are implemented and are working, but there are several important cases which are skipped. Having in mind that the task is to test a simple calculator it is not acceptable to skip the "divide by zero" scenario. Also only successful cases are tested, what if we pass an unimplemented value for parameter "mathOperator" of the method Calculate().
| public class CalculationResult | ||
| { | ||
| public bool isSuccessful { get; set; } | ||
| public bool Successful { get; set; } |
There was a problem hiding this comment.
The tests should not change the existing code!
| { | ||
| case MathOperatorType.Add: | ||
| result.DecimalResult = a + b; | ||
| result.isSuccessful = true; |
|
|
||
| #basic scenarios | ||
|
|
||
| Scenario: Add two numbers |
There was a problem hiding this comment.
I don't see a case testing division by zero.
Can't see a case testing the IsSuccessful = false.
Nothing for the exception logging.
| Scenario: Substract two numbers | ||
| Given a digit is 40 | ||
| And b digit is 20 | ||
| When Substract them |
There was a problem hiding this comment.
Not all possible values of the MathOperatorType enum are tested, "Power" is skipped.
Fixes https://emp-sof-github01.emp.internal.com/eMerchantPay/tech_interviews/issues/1280