Esempio n. 1
0
        /// <summary>
        /// Configures the specified info.
        /// </summary>
        /// <param name="info">The info.</param>
        /// <param name="config">The config.</param>
        public void Configure(PropertyInfo info, LinkedConfiguration config)
        {
            config.IsLazy = IsLazy;
            config.InferType = InferType;

            base.Configure(info, config);
        }
Esempio n. 2
0
        /// <summary>
        /// Configures the specified info.
        /// </summary>
        /// <param name="info">The info.</param>
        /// <param name="config">The config.</param>
        public void Configure(PropertyInfo info, LinkedConfiguration config)
        {
            config.IsLazy    = IsLazy;
            config.InferType = InferType;

            base.Configure(info, config);
        }
        public void Configure_DefaultValues_ConfigSetToDefaults()
        {
            //Assign
            var attr         = new StubLinkedAttribute();
            var config       = new LinkedConfiguration();
            var propertyInfo = typeof(StubItem).GetProperty("X");

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.IsFalse(config.InferType);
        }
Esempio n. 4
0
        public void Configure_DefaultValues_ConfigSetToDefaults()
        {
            //Assign
            var attr         = new StubLinkedAttribute();
            var config       = new LinkedConfiguration();
            var propertyInfo = Substitute.For <PropertyInfo>();

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.IsTrue(config.IsLazy);
            Assert.IsFalse(config.InferType);
        }
        public void Configure_InferTypeIsTrue_ConfigInferTypeIsTrue()
        {
            //Assign
            var attr         = new StubLinkedAttribute();
            var config       = new LinkedConfiguration();
            var propertyInfo = typeof(StubItem).GetProperty("X");

            attr.InferType = true;

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.IsTrue(config.InferType);
        }
Esempio n. 6
0
        public void Configure_IsLazyIsFalse_ConfigIsLazyIsFalse()
        {
            //Assign
            var attr         = new StubLinkedAttribute();
            var config       = new LinkedConfiguration();
            var propertyInfo = Substitute.For <PropertyInfo>();

            attr.IsLazy = false;

            //Act
            attr.Configure(propertyInfo, config);

            //Assert
            Assert.AreEqual(propertyInfo, config.PropertyInfo);
            Assert.IsFalse(config.IsLazy);
            Assert.IsFalse(config.InferType);
        }