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

            IsLazy    = attr.IsLazy;
            InferType = attr.InferType;
            Options   = attr.Option;
            base.ConfigureDataHandler(scProperty);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void Default_Constructor_Set_Setting_To_Default()
        {
            var testSitecoreFieldAttribute = new SitecoreLinkedAttribute();

            Assert.AreEqual(testSitecoreFieldAttribute.Option, SitecoreLinkedOptions.All);
        }