public override void ConfigureDataHandler(SitecoreProperty scProperty) { SitecoreInfoAttribute attr = scProperty.Attribute as SitecoreInfoAttribute; InfoType = attr.Type; UrlOptions = Utility.CreateUrlOptions(attr.UrlOptions); base.ConfigureDataHandler(scProperty); }
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); }
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); }
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); }