//测试结果是否为整数 public void TestMethod3() { double testnum1 = 5.63; double testnum2 = 45; if (Linkup.nonnegint(testnum1)) { Console.WriteLine("testnum1测试正确"); } else { Console.WriteLine("testnum1测试错误"); } if (Linkup.nonnegint(testnum2)) { Console.WriteLine("testnum2测试正确"); } else { Console.WriteLine("testnum2测试错误"); } }
//测试两个数的运算 public void TestMethod2() { //testA=8*9 double ResultA = 72; double TestA = Linkup.arith(8, 9, 2); if (ResultA == TestA) { Console.WriteLine("testA的测试结果正确"); } else { Console.WriteLine("testA的测试结果错误"); } //testB=20/40 double ResultB = 0.5; double TestB = Linkup.arith(20, 40, 3); if (ResultB == TestB) { Console.WriteLine("testB的测试结果正确"); } else { Console.WriteLine("testB的测试结果错误"); } //testC=56/8 double ResultC = 7; double TestC = Linkup.arith(56, 8, 3); if (ResultB == TestB) { Console.WriteLine("testC的测试结果正确"); } else { Console.WriteLine("testC的测试结果错误"); } }