static void Main(string[] args) { double x = 6.4; double y = 2.5; Console.WriteLine("x value is " + x); Console.WriteLine("y value is " + y); Calcuator cal = new Calcuator(); Console.WriteLine("Addition of x and y is "+cal.Addition(x, y)); Console.WriteLine("Substraction of x and y is " + cal.Substraction(x, y)); Console.WriteLine("Multiplication of x and y is " + cal.Multiplication(x, y)); Console.WriteLine("Division of x and y is " + cal.Division(x, y)); Console.WriteLine("Modulos of x and y is " + cal.Modulos(x, y)); }
public void TestModulos() { Calcuator calc = new Calcuator(); // arrange double x = 6.0; double y = 4.0; double expected = 2; // act double result = calc.Modulos(x, y); // assert Assert.AreEqual(expected,result); }
public void TestIsNegativeNumber() { PrivateObject cal = new PrivateObject(typeof(Calcuator)); Calcuator calc = new Calcuator(); // arrange double x = -6.0; bool expected = true; // act bool result =Convert.ToBoolean( cal.Invoke("IsNegative", x)); // assert Assert.AreEqual(result, expected); }
public void TestDivision() { Calcuator calc = new Calcuator(); // arrange double x = 6.8; double y = 4.2; double expected = 1.6; // act double result = calc.Division(x, y); // assert Assert.AreEqual(expected,result); }
public void TestAddition() { Calcuator calc = new Calcuator(); // arrange double x = 5.6; double y = 3.2; double expected = 8.8; // act double result = calc.Addition(x, y); // assert Assert.AreEqual(expected,result); }
public void TestMultiplication() { Calcuator calc = new Calcuator(); // arrange double x = 6.0; double y = 4.2; double expected = 25.2; // act double result = (calc.Multiplication(x, y)); // assert Assert.AreEqual(expected,result); }
public void TestSubstraction() { Calcuator calc = new Calcuator(); // arrange double x = 6.4; double y = 4.2; double expected = 2.2; // act double result = calc.Substraction(x, y); // assert Assert.AreEqual(expected,result); }