Esempio n. 1
0
        public void TestMethodKali()
        {
            MainWindow kal = new MainWindow();
            double a1 = 4;
            double b1 = 2;
            double result = kal.kali(a1, b1);
            double hasil = 8;

            Assert.AreEqual(hasil, result, "Salah");
        }
        public void TestMethodKali()
        {
            MainWindow hitung = new MainWindow();
            int angka1 = 2;
            int angka2 = 1;
            double expect = 2;
            double actual = hitung.kali(angka1, angka2);

            Assert.AreEqual(expect, actual, "true");
        }
Esempio n. 3
0
 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));
 }