Exemple #1
0
        public void Given_NullableSignedNumericValue_ThatIsNull_WhenCheck_HasValue_ThenItThrowsCorrectException()
        {
            //Arrange
            var actionsList = new List <Action>()
            {
                () => { UnsignedNullableNumericFactory.CreateUIntWithNull().Check().HasValue(); },
                () => { UnsignedNullableNumericFactory.CreateULongWithNull().Check().HasValue(); },
                () => { UnsignedNullableNumericFactory.CreateByteWithNull().Check().HasValue(); },
                () => { UnsignedNullableNumericFactory.CreateUShortWithNull().Check().HasValue(); },
            };

            //Act

            //Assert
            foreach (var action in actionsList)
            {
                action.ShouldThrow <ArgumentOutOfRangeException>();
            }
        }