示例#1
0
            public static SitecoreType <ProtectedModel> Load()
            {
                var config = new SitecoreType <ProtectedModel>();

                config.Field(x => x.Field1);
                config.Field(x => x.Field2);
                return(config);
            }
示例#2
0
            public static SitecoreType <PrivateModelRecursive> Load()
            {
                var config = new SitecoreType <PrivateModelRecursive>();

                config.Field(x => x.Field1);
                return(config);
            }
        public void Import_ImportTypeFieldDefinedTwice_DoesNotThrowException()
        {
            //Arrange
            var type1 = new SitecoreType<Stub1>();
            type1.Field(x => x.Field1);

            var type2 = new SitecoreType<Stub2>();
            type2.Field(x => x.Field1);
            type2.Field(x => x.Field2);

            //Act
            type2.Import(type1);

            //Assert
            Assert.AreEqual(2, type2.Config.Properties.Count());

        }
示例#4
0
        public void Import_ImportTypeFieldDefinedTwice_DoesNotThrowException()
        {
            //Arrange
            var type1 = new SitecoreType <Stub1>();

            type1.Field(x => x.Field1);

            var type2 = new SitecoreType <Stub2>();

            type2.Field(x => x.Field1);
            type2.Field(x => x.Field2);

            //Act
            type2.Import(type1);

            //Assert
            Assert.AreEqual(2, type2.Config.Properties.Count());
        }
        public void Import_ImportType_AddsPropertiesToNewType()
        {
            //Arrange
            var type1 = new SitecoreType<Stub1>();
            type1.Field(x => x.Field1);

            var type2 = new SitecoreType<Stub2>();
            type2.Field(x => x.Field2);

            //Act
            type2.Import(type1);

            //Assert
            Assert.AreEqual(2, type2.Config.Properties.Count());
            
        }
示例#6
0
        public void Import_ImportType_AddsPropertiesToNewType()
        {
            //Arrange
            var type1 = new SitecoreType <Stub1>();

            type1.Field(x => x.Field1);

            var type2 = new SitecoreType <Stub2>();

            type2.Field(x => x.Field2);

            //Act
            type2.Import(type1);

            //Assert
            Assert.AreEqual(2, type2.Config.Properties.Count());
        }