コード例 #1
0
        public void SubstractDecimalAndNegative()
        {
            SimpleCalc simpleCalc = new SimpleCalc();
            double     a          = 0.120;
            double     b          = -2.0;

            double ans    = a - b;
            double result = simpleCalc.substractNumbers(a, b);

            Assert.AreEqual(result, ans);
        }
コード例 #2
0
        public void SubstractWholeNumberAndDecimal()
        {
            SimpleCalc simpleCalc = new SimpleCalc();
            double     a          = 12.0;
            double     b          = 0.1230;

            double ans    = a - b;
            double result = simpleCalc.substractNumbers(a, b);

            Assert.AreEqual(result, ans);
        }
コード例 #3
0
        public void SubstractTwoDecimals()
        {
            SimpleCalc simpleCalc = new SimpleCalc();
            double     a          = 0.123342130;
            double     b          = 0.123342130;

            double ans    = a - b;
            double result = simpleCalc.substractNumbers(a, b);

            Assert.AreEqual(result, ans);
        }
コード例 #4
0
        public void SubstractTwoLargeNumbers()
        {
            SimpleCalc simpleCalc = new SimpleCalc();
            double     a          = 1973820.0;
            double     b          = 1256890.0;

            double ans    = a - b;
            double result = simpleCalc.substractNumbers(a, b);

            Assert.AreEqual(result, ans);
        }
コード例 #5
0
        public void SubstractOneZeroOneNegative()
        {
            SimpleCalc simpleCalc = new SimpleCalc();
            double     a          = 0.0;
            double     b          = -10.0;

            double ans    = a - b;
            double result = simpleCalc.substractNumbers(a, b);

            Assert.AreEqual(result, ans);
        }
コード例 #6
0
        public void SubstractTwoPositives()
        {
            SimpleCalc simpleCalc = new SimpleCalc();
            double     a          = 10.0;
            double     b          = 10.0;

            double ans    = a - b;
            double result = simpleCalc.substractNumbers(a, b);

            Assert.AreEqual(result, ans);
        }