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);
        }