public void Add_WhenCalled_ReturnTheSumOfArgument()
        {
            // Act
            var result = mathCalculator.Add(1, 2);

            // Assert
            Assert.AreEqual(3, result);
        }
Пример #2
0
        public void VerifyAddMethodWorkingProperly()
        {
            var calculator = new MathCalculator();

            var result = calculator.Add(10, 20);

            Assert.AreEqual(30, result);
        }
Пример #3
0
        public void Test()
        {
            float x = 10;

            var mathCalculator = new MathCalculator();

            var result = mathCalculator.Add(1, 2);
        }
Пример #4
0
        public void Add_WhenCalled_ReturnsTheSumOfArguments()
        {
            // Act
            var result = mathCalculator.Add(1, 2);

            // Assert
            result.Should().Be(3);
        }
Пример #5
0
        public void Add_OneIntOneNull_ReturnsZero()
        {
            var mathCalculator = new MathCalculator();

            var zero = mathCalculator.Add(2, null);

            Assert.AreEqual(0, zero);
        }
Пример #6
0
        // Method_Schenario_ExpectedBehaviour
        public void Add_TwoInts_ReturnsAdd()
        {
            // Arrange: Create objets
            var mathCalculator = new MathCalculator();

            // Act: Call a method
            var seven = mathCalculator.Add(2, 5);

            // Aset: Verify result
            Assert.AreEqual(7, seven.Value);
        }