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