Exemplo n.º 1
0
        public void TestAdd()
        {
            BasicOperations basicOperations = new BasicOperations();
            int             actualResult    = basicOperations.Add(2, 3);
            int             expectedResult  = 5;

            Assert.AreEqual(expectedResult, actualResult);
        }
Exemplo n.º 2
0
        public void Add_whileLoop(int value, int expected)
        {
            // Act
            var result = _basicOperations.Add(value);

            // Assert
            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void Add_AddPositiveNumbers_ResultIsCorrect(int first, int second, int expected)
        {
            var basicOperations = new BasicOperations();

            var result = basicOperations.Add(first, second);

            Assert.Equal(result, expected);
        }
Exemplo n.º 4
0
        public void Substract_TwoPositiveNumbers_ResultIsEqualToSubstraction()
        {
            BasicOperations sut = new BasicOperations();

            int result = sut.Add(-3, -5);

            Assert.Equal(8, result);
        }
Exemplo n.º 5
0
        public void Add_AddPositiveNumbers_ResultIsCorrect()
        {
            var basicOperations = new BasicOperations();

            //Мы вставляем произвольные значения, однако они должны быть указаны явно
            //Это означает, что не стоит применять никаких Math.Random() и тому подобных методов.
            //Тестовый метод должен быть максимально стабильным
            var result = basicOperations.Add(5, 1);

            Assert.AreEqual(result, 6);
        }
Exemplo n.º 6
0
        public void Add_TwoPositiveNumbers_ResultIsEqualToSumOfNumbers(int firstNumber, int secondNumber, int sum)
        {
            // Arrange
            BasicOperations sut = new BasicOperations();

            // Act
            int result = sut.Add(firstNumber, secondNumber);

            // Assert
            Assert.Equal(sum, result);
        }
Exemplo n.º 7
0
        public void Add_AddTwoIntegers_ResultIsCorrect(int firstNumber, int secondNumber, int expected)
        {
            //Arrange
            BasicOperations basicOperations = new BasicOperations();

            //Act
            var result = basicOperations.Add(firstNumber, secondNumber);

            //Assert
            Assert.Equal(expected, result);
        }
Exemplo n.º 8
0
        public void AddTest()
        {
            BasicOperations target   = new BasicOperations(); // TODO: Initialize to an appropriate value
            int             numberA  = 0;                     // TODO: Initialize to an appropriate value
            int             numberB  = 0;                     // TODO: Initialize to an appropriate value
            int             expected = 0;                     // TODO: Initialize to an appropriate value
            int             actual;

            actual = target.Add(numberA, numberB);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
Exemplo n.º 9
0
        public void Add_AddPositiveNumbersUsingAAA_ResultIsCorrect()
        {
            //Arrange
            var basicOperations = new BasicOperations();

            //Act
            var result = basicOperations.Add(5, 1);

            //Assert
            var expectedResult = 6;

            Assert.AreEqual(result, expectedResult);
        }
Exemplo n.º 10
0
        public void Add_AddNegativeNumbers_ResultIsCorrect()
        {
            //Lets try to use debug mode here
            //Arrange
            var basicOperations = new BasicOperations();

            //Act
            var result = basicOperations.Add(-5, -1);

            //Assert
            var expectedResult = -6;

            Assert.AreEqual(result, expectedResult);
        }