public override void ConfigureDataHandler(SitecoreProperty scProperty) { SitecoreLinkedAttribute attr = scProperty.Attribute as SitecoreLinkedAttribute; IsLazy = attr.IsLazy; InferType = attr.InferType; Options = attr.Option; base.ConfigureDataHandler(scProperty); }
public void Configure_ConfigureCalled_SitecoreLinkedConfigurationReturned() { //Assign SitecoreLinkedAttribute attr = new SitecoreLinkedAttribute(); var propertyInfo = typeof(StubClass).GetProperty("DummyProperty"); //Act var result = attr.Configure(propertyInfo) as SitecoreLinkedConfiguration; //Assert Assert.IsNotNull(result); Assert.AreEqual(SitecoreLinkedOptions.All, result.Option); }
public void Configure_OptionSet_OptionSetOnConfiguration() { //Assign SitecoreLinkedAttribute attr = new SitecoreLinkedAttribute(); var propertyInfo = typeof(StubClass).GetProperty("DummyProperty"); attr.Option = SitecoreLinkedOptions.Referrers; //Act var result = attr.Configure(propertyInfo) as SitecoreLinkedConfiguration; //Assert Assert.IsNotNull(result); Assert.AreEqual(SitecoreLinkedOptions.Referrers, result.Option); }
public void Default_Constructor_Set_Setting_To_Default() { var testSitecoreFieldAttribute = new SitecoreLinkedAttribute(); Assert.AreEqual(testSitecoreFieldAttribute.Option, SitecoreLinkedOptions.All); }