Ejemplo n.º 1
0
        public void AdditionTestPos()                     // Test of addition method when positive decimal numbers are used
        {
            double result = Brain.Addition(1.545, 1.455); // Arrange

            // Act
            Assert.Equal(3, result);                                    // Assert
        }
Ejemplo n.º 2
0
        public void AdditionArrTestPos()                // Test of addition method in an array when decimal numbers are used
        {
            double[] arrTestNumbers = { 1.545, 1.455 }; // Arrange
            double   expected       = 3;
            double   result;

            result = Brain.Addition(arrTestNumbers);                    // Act

            Assert.Equal(expected, result, 4);                          // Assert
        }
Ejemplo n.º 3
0
        public void AdditionTestAdv()       // Test of addition method when positive/negative decimal numbers are used
        {
            double result = Brain.Addition(-0.6542, 658.32);

            Assert.Equal(657.6658, result, 4);
        }
Ejemplo n.º 4
0
        public void AdditionTestNeg()       // Test of addition method when negative decimal numbers are used
        {
            double result = Brain.Addition(-8.9331, -6.7633);

            Assert.Equal(-15.6964, result, 4);
        }