コード例 #1
0
        public void SimpleTest(double firstarg, double seconarg, double expected)
        {
            Subtraction calc   = new Subtraction();
            double      result = calc.Calculate(firstarg, seconarg);

            Assert.AreEqual(expected, result);
        }
コード例 #2
0
        public void Calcpr()
        {
            var calculator = new Subtraction();
            var actual     = calculator.Calculate(9, 3);

            Assert.AreEqual(6, actual);
        }
コード例 #3
0
        public void CalculateTest()
        {
            var calculator = new Subtraction();
            var actual     = calculator.Calculate(10, 5);

            Assert.AreEqual(5, actual, 0.01);
        }
コード例 #4
0
        public void DivisionTest(double first, double second, double expected)
        {
            ICalculate calculate = new Subtraction();
            double     result    = calculate.Calculate(first, second);

            Assert.AreEqual(expected, result);
        }
コード例 #5
0
        public void Calculate(double firstArgument, double secondArgument, double result)
        {
            var calculator = new Subtraction();
            var testresult = calculator.Calculate(firstArgument, secondArgument);

            Assert.AreEqual(result, testresult);
        }
コード例 #6
0
        public void AdditionTest(double firstValue, double secondValue, double expected)
        {
            var calculator   = new Subtraction();
            var actualResult = calculator.Calculate(firstValue, secondValue);

            Assert.AreEqual(expected, actualResult);
        }
コード例 #7
0
        public void CalculateTest(double first, double second, double expected)
        {
            var calculator   = new Subtraction();
            var actualResult = calculator.Calculate(first, second);

            Assert.AreEqual(expected, actualResult);
        }
コード例 #8
0
ファイル: UnitTest1.cs プロジェクト: ShwethaMohan/SonarQube
        public void Test2()
        {
            var calculation = new Subtraction(10, 10);
            var result      = calculation.Calculate();

            Assert.Equal(0, result);
        }
コード例 #9
0
        public void SucessOperation( )
        {
            Subtraction subtraction = new Subtraction( );

            double a = 1;
            double b = 2;

            double result = subtraction.Calculate(a, b);

            Assert.True((a - b) == result);
        }
コード例 #10
0
        public void calculate_should_return_real_number_with_subtrted_value()
        {
            // Given
            SUT = new Subtraction(new RealNumber(2.0), new RealNumber(6.0));

            // When
            var result = SUT.Calculate();

            // Then
            Assert.IsInstanceOf<RealNumber>(result);
        }
コード例 #11
0
        public void calculate_should_return_number_that_is_the_subtraction()
        {
            // Given
            SUT = new Subtraction(new RealNumber(2.0), new RealNumber(6.0));

            // When
            var result = SUT.Calculate() as RealNumber;

            // Then
            Assert.AreEqual(-4.0, result.Value);
        }
コード例 #12
0
        public void SubtractDoubleTest(double num1, double num2, double expected)
        {
            //arrange:
            double result = 0;

            Subtraction sub = new Subtraction();

            //act:
            result = sub.Calculate(num1, num2);

            //assert:
            string strMessage = string.Format("Input: {0} - {1} = {2}. Expected: {3}",
                                              num1, num2, result, expected
                                              );

            Assert.AreEqual(expected, result, strMessage);
        }
コード例 #13
0
        public void Subtraction(decimal x, decimal y, decimal result)
        {
            var calculation = new Subtraction(x, y);

            calculation.Calculate().Should().Be(result);
        }