public void TestMethodKurang() { MainWindow kal = new MainWindow(); double a1 = 4; double b1 = 2; double result = kal.kurang(a1, b1); double hasil = 2; Assert.AreEqual(hasil, result, "Salah"); }
public void TestMethodKurang() { MainWindow hitung = new MainWindow(); int angka1 = 1; int angka2 = 1; double expect = 0; double actual = hitung.kurang(angka1, angka2); Assert.AreEqual(expect, actual, "true"); }
public void TestMethod1() { MainWindow mw = new MainWindow(); //tes tambah Assert.AreEqual(2, mw.tambah(1,1.0)); //tes kurang Assert.AreEqual(0, mw.kurang(0.99,0.99)); //tes kali Assert.AreEqual(1, mw.kali(1.0, 1.0)); //tes bagi Assert.AreEqual(1, mw.bagi(0.9909090, 0.9909090)); Assert.AreEqual(double.PositiveInfinity, mw.bagi(9, 0)); Assert.AreEqual(double.NegativeInfinity, mw.bagi(-9, 0)); Assert.AreEqual(-1, mw.bagi(-9, 9)); }