Configure() public method

Configures the specified property info.
public Configure ( PropertyInfo propertyInfo ) : Mapper.Configuration.AbstractPropertyConfiguration
propertyInfo System.Reflection.PropertyInfo The property info.
return Mapper.Configuration.AbstractPropertyConfiguration
コード例 #1
0
        public void Configure_ConfigureCalled_SitecoreInfoConfigurationReturned()
        {
            //Assign
            SitecoreInfoAttribute attr = new SitecoreInfoAttribute();
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");


            //Act
            var result = attr.Configure(propertyInfo) as SitecoreInfoConfiguration;

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(SitecoreInfoType.NotSet, result.Type);
            Assert.AreEqual(SitecoreInfoUrlOptions.Default, result.UrlOptions);
        }
コード例 #2
0
        public void Configure_UrlOptionsSet_UrlOptionsSetOnConfiguration()
        {
            //Assign
            SitecoreInfoAttribute attr = new SitecoreInfoAttribute();
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");
            attr.UrlOptions = SitecoreInfoUrlOptions.LanguageEmbeddingAsNeeded;

            //Act
            var result = attr.Configure(propertyInfo) as SitecoreInfoConfiguration;

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(SitecoreInfoUrlOptions.LanguageEmbeddingAsNeeded, result.UrlOptions);
        }
コード例 #3
0
        public void Configure_TypeSet_TypeSetOnConfiguration()
        {
            //Assign
            SitecoreInfoAttribute attr = new SitecoreInfoAttribute();
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");
            attr.Type = SitecoreInfoType.Language;

            //Act
            var result = attr.Configure(propertyInfo) as SitecoreInfoConfiguration;

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(SitecoreInfoType.Language, result.Type);
        }