public void CalculateFromText_ShouldThrowExceptionForMathematicalError(
            string invalidEquation, MathematicalError expectedErrorType
            )
        {
            var calculator = new CalculatorModel();
            CalculationParseMathematicalException thrownException =
                Assert.Throws <CalculationParseMathematicalException>(
                    () => calculator.CalculateFromText(invalidEquation)
                    );
            MathematicalError actualErrorType = thrownException.MathematicalErrorType;

            Assert.Equal(expectedErrorType, actualErrorType);
        }
Exemple #2
0
 public CalculationParseMathematicalException(
     string message, MathematicalError _MathematicalErrorType
     ) : base(message)
 {
     this.MathematicalErrorType = _MathematicalErrorType;
 }