public void VerifyDivideMethodReturnsCorrectDividendOfTwoNumbers() { CalculatorClass obj4 = new CalculatorClass(); obj4.Add(4, 5); Assert.AreEqual(0, obj4.quotient); }
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 傳入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); }