Beispiel #1
0
        public void Given_NullableSignedNumericValue_ThatIsNull_WhenCheck_HasValue_ThenItThrowsCorrectException()
        {
            //Arrange
            var actionsList = new List <Action>()
            {
                () => { SignedNullableNumericFactory.CreateIntWithNull().Check().HasValue(); },
                () => { SignedNullableNumericFactory.CreateLongWithNull().Check().HasValue(); },
                () => { SignedNullableNumericFactory.CreateDecimalWithNull().Check().HasValue(); },
                () => { SignedNullableNumericFactory.CreateFloatWithNull().Check().HasValue(); },
                () => { SignedNullableNumericFactory.CreateShortWithNull().Check().HasValue(); },
                () => { SignedNullableNumericFactory.CreateSbyteWithNull().Check().HasValue(); },
            };

            //Act

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