public void Check_For_Divide_by_0() { int a = 1, b = 0; object result = CalcFunctions.Divide(a, b); Assert.AreEqual(result.ToString(), "DIV BY 0"); }
public void CalculateCurrentAnswerSyntaxErrorTest() { double currentAnswer = 123.4; string currentInput = "1,54,"; string previousOperator = "+"; CalcFunctions.CalculateCurrentAnswer(currentAnswer, currentInput, previousOperator); }
public void CalcFunctions_Subtract_Two_Double_Numbers() { double a = 2.393, b = 4.9393; double result = (double)CalcFunctions.Subtract(a, b); Assert.AreEqual(result, a - b); }
public void CalcFunctions_Multiply_Two_Double_Numbers() { double a = 2.393, b = 4.9393; double result = (double)CalcFunctions.Multiply(a, b); Assert.AreEqual(result, a * b); }
public void CalcFunctions_Divide_Two_Double_Numbers() { double a = 2.393, b = 4.9393; double result = (double)CalcFunctions.Divide(a, b); Assert.AreEqual(result, a / b); }
public void CalcFunctions_Add_Two_Double_Numbers() { double a = 2.393, b = 4.9393; double result = (double)CalcFunctions.Add(a, b); Assert.AreEqual(result, a + b); }
public void CalcFunctions_Subtract_Two_Numbers() { int a = 1, b = 2; int result = (int)CalcFunctions.Subtract(b, a); Assert.AreEqual(result, b - a); }
public void CalcFunctions_Multiply_Two_Numbers() { int a = 2, b = 3; int result = (int)CalcFunctions.Multiply(a, b); Assert.AreEqual(result, a * b); }
public void CalculateCurrentAnswerDivideByZeroTest() { double currentAnswer = 123.4; string currentInput = "0"; string previousOperator = "/"; CalcFunctions.CalculateCurrentAnswer(currentAnswer, currentInput, previousOperator); }
public void CalcFunctions_Subtract_Int_And_Double_Numbers() { double a = 12.392; int b = 5; double result = (double)CalcFunctions.Subtract(a, b); Assert.AreEqual(result, a - b); }
public void CalcFunctions_Add_Int_And_Double_Numbers() { double a = 32.32232; int b = 5; double result = (double)CalcFunctions.Add(a, b); Assert.AreEqual(result, a + b); }
public void Check_For_Integer_Underflow_Sub() { int a = Int32.MinValue; int b = 1; object result = CalcFunctions.Subtract(a, b); Assert.AreEqual(result.ToString(), "UNDERFLOW"); }
public void Check_For_Integer_Overflow_Add() { int a = Int32.MaxValue; int b = 1; object result = CalcFunctions.Add(a, b); Assert.AreEqual(result.ToString(), "OVERFLOW"); }
public void CalcFunctions_Divide_Int_Double_Numbers() { double a = 9.32314; int b = 3; double result = (double)CalcFunctions.Divide(a, b); Assert.AreEqual(result, a / b); }
public void CalcFunctions_Multiply_Int_And_Double_Numbers() { double a = 2.3939; int b = 9; double result = (double)CalcFunctions.Multiply(a, b); Assert.AreEqual(result, a * b); }
public void CalcFunctions_add_Two_Numbers() { //Arrange int a = 1, b = 2; //Act int result = (int)CalcFunctions.Add(a, b); //Assert Assert.AreEqual(result, a + b); }
public void CalculateCurrentAnswerTest() { double currentAnswer = 123.4; string currentInput = "1"; string previousOperator = "+"; currentAnswer = CalcFunctions.CalculateCurrentAnswer(currentAnswer, currentInput, previousOperator).Item2; Assert.AreEqual(124.4, currentAnswer); currentInput = "1,4"; previousOperator = "-"; currentAnswer = CalcFunctions.CalculateCurrentAnswer(currentAnswer, currentInput, previousOperator).Item2; Assert.AreEqual(123, currentAnswer); currentInput = "2"; previousOperator = "*"; currentAnswer = CalcFunctions.CalculateCurrentAnswer(currentAnswer, currentInput, previousOperator).Item2; Assert.AreEqual(246, currentAnswer); currentInput = "2"; previousOperator = "/"; currentAnswer = CalcFunctions.CalculateCurrentAnswer(currentAnswer, currentInput, previousOperator).Item2; Assert.AreEqual(123, currentAnswer); }