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

            var result = config.IsVariableLength();

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

            var result = config.IsVariableLength();

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

            var result = config.IsVariableLength();

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

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

            var result = config.IsVariableLength();

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