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

            var result = config.IsFixedLength();

            Assert.Same(config, result);
        }
Example #2
0
        public void IsFixedLength_configures_when_unset()
        {
            var innerConfig = new Mock <LengthPropertyConfiguration>().Object;
            var config      = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsFixedLength();

            Assert.Equal(true, innerConfig.IsFixedLength);
            Assert.Same(config, result);
        }
        public void IsFixedLength_is_noop_when_not_length()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsFixedLength();

            Assert.Same(config, result);
        }
        public void IsFixedLength_is_noop_when_set()
        {
            var innerConfig = new Mock<LengthPropertyConfiguration>().Object;
            innerConfig.IsFixedLength = false;

            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.IsFixedLength();

            Assert.Equal(false, innerConfig.IsFixedLength);
            Assert.Same(config, result);
        }