Beispiel #1
0
        public void GreaterThanZero_CalledWithZeroOrLess_ThrowsArgumentException(double arg)
        {
            // Act
            Action act = () => CheckArgument.GreaterThanZero(arg, nameof(arg));

            // Assert
            act.Should().Throw <ArgumentException>()
            .WithMessage("Argument 'arg' should be greater than '0'.");
        }
Beispiel #2
0
        public void GreaterThanZero_CalledWithGreaterThanZero_DoesNotThrowArgumentException()
        {
            // Arrange
            double arg = .1;

            // Act
            Action act = () => CheckArgument.GreaterThanZero(arg, nameof(arg));

            // Assert
            act.Should().NotThrow <ArgumentException>();
        }