예제 #1
0
        public void Max_FirstAndSecondArgumentIsEqual_ReturnsTheSameArgument()
        {
            // Act
            var result = mathCalculator.Max(1, 1);

            // Assert
            Assert.AreEqual(1, result);
        }
        public void Max_WhenCalled_ReturnsGreaterArgument(int a, int b, int expected)
        {
            // Act
            var result = mathCalculator.Max(a, b);

            // Assert
            Assert.That(result, Is.EqualTo(expected));
        }
예제 #3
0
        public void Max_FirstAndSecondArgumentIsEqual_ReturnsTheSameArgument()
        {
            // Act
            var result = mathCalculator.Max(1, 1);

            // Assert
            result.Should().Be(1);
        }
        public void Max_FirstArgumentIsGreaterThanSecondArgument_ReturnFirstArgument()
        {
            // Act
            var result = mathCalculator.Max(2, 1);

            // Assert
            Assert.AreEqual(2, result);
        }
예제 #5
0
        public void Max_FirstArgumentIsGreater_ReturnsTheFirstArgument()
        {
            // Arrange

            // Act
            var result = mathCalculator.Max(2, 1);

            // Assert
            result.Should().Be(2);
        }
        public void Max_FirstArgumentIsGreater_ReturnsTheFirstArgument()
        {
            // Arrange

            // Act
            var result = mathCalculator.Max(2, 1);

            // Assert
            Assert.AreEqual(2, result);
        }
예제 #7
0
        public void Max_WhenCalled_ReturnGreaterArgument(int first, int second, int expected)
        {
            // Act
            var result = mathCalculator.Max(first, second);

            // Assert
            Assert.AreEqual(expected, result);

            Assert.That(result, Is.EqualTo(expected));

            // dotnet add package FluentAssertions

            result
            .Should()
            .Be(expected);

            // dotnet add package Shouldly

            result.ShouldBe(expected);
        }