// Sometimes it pays to place a test in a separate // class so you can check just that functionality. public void TestDivideByZero() { string Expected = "0"; string Result = MathCheck.DoDivide("6", "0"); Assert(Expected.Equals(Result)); }
// Test the subtract function using a simple example. public void TestSubtract() { string Expected = "1"; string Result = MathCheck.DoSubtract("3", "2"); Assert(Expected.Equals(Result)); }
// Test the multiply function using a simple example. public void TestMultiply() { string Expected = "6"; string Result = MathCheck.DoMultiply("2", "3"); Assert(Expected.Equals(Result)); }
// Test the add function using a simple example. public void TestAdd() { string Expected = "5"; string Result = MathCheck.DoAdd("2", "3"); Assert(Expected.Equals(Result)); }