コード例 #1
0
        public override void ConfigureDataHandler(SitecoreProperty scProperty)
        {
            SitecoreInfoAttribute attr = scProperty.Attribute as SitecoreInfoAttribute;

            InfoType = attr.Type;

            UrlOptions = Utility.CreateUrlOptions(attr.UrlOptions);

            base.ConfigureDataHandler(scProperty);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
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);
        }