public void kurang()
 {
     var test_object = new MainWindow();
     double expected = 2;
     double actual = test_object.Substract(5, 3);
     Assert.AreEqual<double>(expected, actual, "Maaf salah");
 }
 public void kali()
 {
     var test_object = new MainWindow();
     double expected = 6;
     double actual = test_object.Multiply(3, 2);
     Assert.AreEqual<double>(expected, actual, "Maaf salah");
 }
 public void jumlah()
 {
     var test_object = new MainWindow();
     double expected = 9;
     double actual = test_object.Add(4, 5);
     Assert.AreEqual<double>(expected, actual, "Maaf salah");
 }
 public void bagi()
 {
     var test_object = new MainWindow();
     double expected = 3;
     double actual = test_object.Divide(9, 3);
     Assert.AreEqual<double>(expected, actual, "Maaf salah");
 }
예제 #5
0
        public void TestMethodTambah()
        {
            MainWindow kal = new MainWindow();
            double a1 = 3;
            double b1 = 3;
            double result = kal.tambah(a1, b1);
            double hasil = 6;

            Assert.AreEqual(hasil, result, "Salah");
        }
예제 #6
0
        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");
        }
예제 #7
0
        public void TestMethodSubstaction()
        {
            MainWindow calc = new MainWindow();
            double op1 = 3;
            double op2 = 1;
            double expect = 2;
            double actual = calc.substraction(op1, op2);

            Assert.AreEqual(expect, actual, "true");
        }
예제 #8
0
        public void TestMethodMultiplication()
        {
            MainWindow calc = new MainWindow();
            double op1 = 7;
            double op2 = 8;
            double expect = 56;
            double actual = calc.multipication(op1, op2);

            Assert.AreEqual(expect, actual, "true");
        }
예제 #9
0
        public void TestMethodDivision()
        {
            MainWindow calc = new MainWindow();
            double op1 = 16;
            double op2 = 2;
            double expect = 8;
            double actual = calc.division(op1, op2);

            Assert.AreEqual(expect, actual, "true");
        }
예제 #10
0
        public void TestMethodAddition()
        {
            MainWindow calc = new MainWindow();
            double op1 = 4;
            double op2 = 7;
            double expect = 11;
            double actual = calc.addition(op1, op2);

            Assert.AreEqual(expect, actual, "true");
        }
예제 #11
0
        public void TestMethodTambah()
        {
            MainWindow hitung = new MainWindow();
            int angka1 = 1;
            int angka2 = 1;
            double expect = 2;
            double actual = hitung.tambah(angka1, angka2);

            Assert.AreEqual(expect, actual, "true");
        }
예제 #12
0
        public void TestMethodBagi()
        {
            MainWindow hitung = new MainWindow();
            int angka1 = 4;
            int angka2 = 2;
            double expect = 2;
            double actual = hitung.bagi(angka1, angka2);

            Assert.AreEqual(expect, actual, "true");
        }
예제 #13
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));
 }
예제 #14
0
 private void ShowNewForm(object sender, EventArgs e)
 {
     MyCalculatorv1.MainWindow cal = new MyCalculatorv1.MainWindow();
     cal.Show();
 }