public void Test_SubstractMethod() { BasicMaths bm = new BasicMaths(); double res = bm.Substract(10, 10); Assert.AreEqual(res, 0); }
public void TestSubstractMethod() { BasicMaths bm = new BasicMaths(); double result = bm.Substract(10, 3); Assert.AreEqual(result, 7); }
public void SubstractTest() { //Arrange BasicMaths sub = new BasicMaths(); double expected = 10; //Act double actual = sub.Substract(20, 10); //Assert Assert.AreEqual(expected, actual); }
static void Main(string[] args) { BasicMaths bm = new BasicMaths(); string strWriteFilePath = @"WriteLog.txt"; StreamWriter swWriteFile = File.CreateText(strWriteFilePath); for (int i = 0; i < 1000; i++) { double res1 = bm.Add(i, 1); double res2 = bm.Substract(i, 1); double res3 = bm.divide(i, 2); double res4 = bm.Multiply(i, 2); Console.WriteLine(res1.ToString() + ' ' + res2.ToString() + ' ' + res3.ToString() + ' ' + res4.ToString() + ' '); swWriteFile.WriteLine(res1.ToString() + ' ' + res2.ToString() + ' ' + res3.ToString() + ' ' + res4.ToString() + ' '); //写入读取的每行数据 //Console.WriteLine(res2.ToString() + ' '); //Console.WriteLine(res3.ToString() + ' '); //Console.WriteLine(res4.ToString() + ' ' + '\n'); System.Threading.Thread.Sleep(2000); } }
public void Test_SubstractMethod() { double r = BasicMaths.Substract(10, 10); Assert.AreEqual(r, 0); }