public void Test_Multiplication_Calc() { Logic.Calculator calculator = new Logic.Calculator(); calculator.Number_entered(30.0); calculator.Multiplication_entered(); calculator.Number_entered(2.0); Assert.AreEqual("60", calculator.Equals()); }
public void Test_Square_Root_Calc() { Logic.Calculator calculator = new Logic.Calculator(); calculator.Number_entered(9.0); calculator.Square_root_entered(); calculator.Number_entered(2.0); Assert.AreEqual("3", calculator.Equals()); }
public void Test_Subtraction_Calc() { Logic.Calculator calculator = new Logic.Calculator(); calculator.Number_entered(99.5); calculator.Subtraction_entered(); calculator.Number_entered(1.0); Assert.AreEqual("98.5", calculator.Equals()); }
public void Test_Division_Calc() { Logic.Calculator calculator = new Logic.Calculator(); calculator.Number_entered(30.0); calculator.Division_entered(); calculator.Number_entered(2.0); Assert.AreEqual("15", calculator.Equals()); }
public void Test_Subtraction_1() { Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(1); Calc.Subtraction_entered(); Calc.Number_entered(1); string result = Calc.Equals(); Assert.AreEqual("0", result); }
public void Test_Addition_2() { Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(1); Calc.Addition_entered(); Calc.Number_entered(1); Calc.Equals(); string result = Calc.Equals(); Assert.AreEqual("3", result); }
public void Test_Example() { Logic.Calculator calculator = new Logic.Calculator(); string result = calculator.Number_entered(51.6); result = calculator.Addition_entered(); Assert.AreEqual("51.6", result); result = calculator.Number_entered(25.1); Assert.AreEqual("25.1", result); Assert.AreEqual("76.7", calculator.Equals()); Assert.AreEqual("76.7", calculator.Equals()); }
public void Multiple_Operators() { Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(1); Calc.Addition_entered(); Calc.Subtraction_entered(); Calc.Number_entered(1); Calc.Equals(); string result = Calc.Equals(); Assert.AreEqual("-1", result); }
public void Test_Divide_Zero() { double rhs = 0; double lhs = 10; Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(lhs); Calc.Division_entered(); string result = Calc.Number_entered(rhs); Assert.AreEqual("Invalid Input", result); Assert.AreEqual("Divide by Zero Error", result.ToString()); }
public void Test_Addition_Calc() { Logic.Calculator calculator = new Logic.Calculator(); calculator.Number_entered(99.5); calculator.Addition_entered(); Assert.AreEqual("99.5", calculator.Equals()); }
public void Test_Reciprocal_Calc() { Logic.Calculator calculator = new Logic.Calculator(); calculator.Number_entered(-4.0); calculator.Reciprocal_entered(); Assert.AreEqual("-0.25", calculator.Equals()); }
public void Test_SquareRoot_Negative() { double lhs = -4; Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(lhs); string result = Calc.Square_root_entered(); Assert.AreEqual("Invalid Input", result); }
public void Test_Reciprocal_Zero() { double lhs = 0; Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(lhs); string result = Calc.Square_root_entered(); Assert.AreEqual("Divide by Zero Error", result.ToString()); }
public void Test_Reciprocal_1() { Logic.Calculator Calc = new Logic.Calculator(); Calc.Number_entered(2); Calc.Reciprocal_entered(); Calc.Reciprocal_entered(); Calc.Reciprocal_entered(); string result = Calc.Reciprocal_entered(); Assert.AreEqual("2", result); }