public void DivisionTest() { CalculatorClass sut = new CalculatorClass(); var actualQuotient = sut.Quotient(10.0, 1.0); Assert.Equal(10, actualQuotient); }
public void SubtractionTest() { CalculatorClass sut = new CalculatorClass(); var actualDifference = sut.Difference(10.0, 5.0); Assert.Equal(5, actualDifference); }
public void MultiplicationTest() { CalculatorClass sut = new CalculatorClass(); var actualProduct = sut.Product(10.0, 10.0); Assert.Equal(100, actualProduct); }
public void VerifyDivideMethodReturnsCorrectDividendOfTwoNumbers() { CalculatorClass obj4 = new CalculatorClass(); obj4.Add(4, 5); Assert.AreEqual(0, obj4.quotient); }
public void VerifyMultiplyMethodReturnsCorrectProductOfTwoNumbers() { CalculatorClass obj3 = new CalculatorClass(); obj3.Multiply(4, 5); Assert.AreEqual(20, obj3.product); }
public void VerifySubtractMethodReturnsCorrectDifferenceOfTwoNumbers() { CalculatorClass obj2 = new CalculatorClass(); obj2.Subtract(4, 5); Assert.AreEqual(-1, obj2.diff); }
public void VerifyAddMethodReturnsCorrectSumOfTwoNumbers() { //Arrange..set up the test CalculatorClass obj = new CalculatorClass(); //Act...actionable event obj.Add(4, 5); //Assert..expected result Assert.AreEqual(9, obj.sum); }
public void SumTest() { // Arrange CalculatorClass sut = new CalculatorClass(); // Act var actualSum = sut.Sum(2.5, 2.5); // Assert Assert.Equal(5, actualSum); }
public void 傳入1和2得到結果3() { var calc = new CalculatorClass(); var a = 1; var b = 2; var expect = 3; var result = calc.Add(a, b); Assert.AreEqual(expect, result); }
public void 傳入兩個浮點數() { var calc = new CalculatorClass(); var a = 50.1; var b = 70.1; var expect = 120.2; var result1 = Math.Round(calc.Add1(a, b)); Assert.AreEqual(expect, result1); }
public void Initialize() { calculator = new CalculatorClass(); }