Beispiel #1
0
        public void IsOptional_configures_when_unset()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config      = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsOptional();

            Assert.Equal(true, innerConfig.IsNullable);
            Assert.Same(config, result);
        }
Beispiel #2
0
        public void IsOptional_is_noop_when_set()
        {
            var innerConfig = new PrimitivePropertyConfiguration
            {
                IsNullable = false
            };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsOptional();

            Assert.Equal(false, innerConfig.IsNullable);
            Assert.Same(config, result);
        }
        public void IsOptional_is_noop_when_set()
        {
            var innerConfig = new PrimitivePropertyConfiguration
                                  {
                                      IsNullable = false
                                  };
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsOptional();

            Assert.Equal(false, innerConfig.IsNullable);
            Assert.Same(config, result);
        }
        public void IsOptional_configures_when_unset()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsOptional();

            Assert.Equal(true, innerConfig.IsNullable);
            Assert.Same(config, result);
        }