コード例 #1
0
ファイル: ValidateTests.cs プロジェクト: wiredwiz/FluentGuard
        public void TestValidationOfANullableFloatReturnsCorrectValidator(ValidatorBase validatorBase)
        {
            "Given a new ValidatorBase created from a nullable Float"
            .x(() => validatorBase = Validate.That("foo", (float?)3.302));

            "Test that the type of ValidatorBase returned is a NullableNumericValidator of type Float"
            .x(() => validatorBase.Should().BeOfType(typeof(NullableNumericValidator <float>)));
        }
コード例 #2
0
ファイル: ValidateTests.cs プロジェクト: wiredwiz/FluentGuard
        public void TestValidationOfANullableUnsignedShortReturnsCorrectValidator(ValidatorBase validatorBase)
        {
            "Given a new ValidatorBase created from a nullable unsigned short"
            .x(() => validatorBase = Validate.That("foo", (ushort?)3));

            "Test that the type of ValidatorBase returned is a NullableUnsignedNumericValidator of type unsigned short"
            .x(() => validatorBase.Should().BeOfType(typeof(NullableUnsignedNumericValidator <ushort>)));
        }