Example #1
0
        public void Method_multiply_returns__of_given_values1()
        {
            // arrange
            var math = new Mathematics();

            // act
            var result = math.Multiply(100, -20);

            // assert
            Assert.Equal(-2000, result);
        }
Example #2
0
        public void Method_add_returns_divide_of_given_values1()
        {
            // arrange
            var math = new Mathematics();

            // act
            var result = math.Divide(-10, -10);

            // assert
            Assert.Equal(1, result);
        }
Example #3
0
        public void Method_divide_returns__of_given_values2()
        {
            // arrange
            var math = new Mathematics();

            // act
            var result = math.Divide(100, 100);

            // assert
            Assert.Equal(1, result);
        }
Example #4
0
        public void Method_add_returns_add_of_given_values2()
        {
            // arrange
            var math = new Mathematics();

            // act
            var result = math.Add(40, -20);

            // assert
            Assert.Equal(20, result);
        }
Example #5
0
        public void Method_add_returns_sub_of_given_values2()
        {
            // arrange
            var math = new Mathematics();

            // act
            var result = math.Substract(100, 99);

            // assert
            Assert.Equal(1, result);
        }
Example #6
0
        public void TheoryExample(double x, double y, double expected)
        {
            // arrange
            var math = new Mathematics();

            // act
            var result = math.Add(x, y);

            // assert
            Assert.Equal(expected, result);
        }
Example #7
0
        public void Method_add_returns_mult_of_given_values()
        {
            // arrange
            var math = new Mathematics();

            // act
            double result = math.Multiply(10, 5);

            // assert
            Assert.Equal(50, result);
        }
Example #8
0
        public void Method_add_returns_dev_of_given_values_2()
        {
            // arrange
            var math = new Mathematics();

            // act
            double result = math.Devide(10, 5);

            // assert
            Assert.Equal(2, result);
        }
Example #9
0
        public void Method_add_returns_sub_of_given_values_2()
        {
            // arrange
            var math = new Mathematics();

            // act
            double result = math.Substract(78, 2);

            // assert
            Assert.Equal(76, result);
        }
Example #10
0
        public void Method_add_returns_sum_of_given_values_2()
        {
            // arrange
            var math = new Mathematics();

            // act
            double result = math.Add(-10, 20);

            // assert
            Assert.Equal(10, result);
        }