예제 #1
0
 private static void UnknownShouldBe(float?expected, string expression)
 {
     Assert.AreEqual(expected, EquationSolver.Main(expression));
 }
예제 #2
0
 public void LargeNumber()
 {
     Assert.Throws <OverflowException>(() => EquationSolver.Main("X + 66666666666666666666666666 = ( 3 + 2 ) / 5"));
 }
예제 #3
0
 public void NumbersNotFound()
 {
     Assert.Throws <NumbersNotFoundException>(() => EquationSolver.Main("X = 2X"));
 }
예제 #4
0
 public void UnknownNotFound()
 {
     Assert.Throws <UnknownNotFouldException>(() => EquationSolver.Main("4 + 2 = ( 3 + 2 ) / 0"));
 }
예제 #5
0
 public void EqualsNotFound()
 {
     Assert.Throws <EqualsNotFoundException>(() => EquationSolver.Main("X + 2 ( 3 + 2 ) / 0"));
 }
예제 #6
0
 public void DivideByZero()
 {
     Assert.Throws <DivideByZeroException>(() => EquationSolver.Main("X + 2 = 3 / 0"));
 }