Exemplo n.º 1
0
        public void InRange_InRange_NoException(int underTest)
        {
            //Arrange


            //Act
            var exception = Record.Exception(() => Guards.Int(underTest, nameof(underTest))
                                             .InRange(-5, 10));


            //Assert
            exception.Should().BeNull();
        }
Exemplo n.º 2
0
        public void NotPositive_Positive_Throws(int underTest)
        {
            //Arrange


            //Act
            var exception = Record.Exception(() => Guards.Int(underTest, nameof(underTest))
                                             .NotPositive());


            //Assert
            exception.Should().BeOfType <ArgumentException>();
        }
Exemplo n.º 3
0
        public void InRange_NotInRange_Throws(int underTest)
        {
            //Arrange


            //Act
            var exception = Record.Exception(() => Guards.Int(underTest, nameof(underTest))
                                             .InRange(-5, 10));


            //Assert
            exception.Should().BeOfType <ArgumentException>();
        }
Exemplo n.º 4
0
        public void NotEqual_Equal_Throws()
        {
            //Arrange
            int underTest = 5;

            //Act
            var exception = Record.Exception(() => Guards.Int(underTest, nameof(underTest))
                                             .NotEqual(underTest));


            //Assert
            exception.Should().BeOfType <ArgumentException>();
        }