コード例 #1
0
 public void Test_Subtraction_Calc()
 {
     Logic.Calculator calculator = new Logic.Calculator();
     calculator.Number_entered(99.5);
     calculator.Subtraction_entered();
     calculator.Number_entered(1.0);
     Assert.AreEqual("98.5", calculator.Equals());
 }
コード例 #2
0
        public void Test_Subtraction_1()
        {
            Logic.Calculator Calc = new Logic.Calculator();
            Calc.Number_entered(1);
            Calc.Subtraction_entered();
            Calc.Number_entered(1);
            string result = Calc.Equals();

            Assert.AreEqual("0", result);
        }
コード例 #3
0
        public void Multiple_Operators()
        {
            Logic.Calculator Calc = new Logic.Calculator();
            Calc.Number_entered(1);
            Calc.Addition_entered();
            Calc.Subtraction_entered();
            Calc.Number_entered(1);
            Calc.Equals();
            string result = Calc.Equals();

            Assert.AreEqual("-1", result);
        }