public static SitecoreType <PrivateModelRecursive> Load() { var config = new SitecoreType <PrivateModelRecursive>(); config.Field(x => x.Field1); return(config); }
public static SitecoreType <ProtectedModel> Load() { var config = new SitecoreType <ProtectedModel>(); config.Field(x => x.Field1); config.Field(x => x.Field2); return(config); }
/// <summary> /// Imports another map from the configuration /// </summary> /// <typeparam name="TK"></typeparam> protected override void ImportMap <TK>() { SitecoreType <TK> typeConfig = GetSitecoreType <TK>(); if (typeConfig == null) { return; } GlassType.Import(typeConfig); }
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()); }
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()); }
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_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()); }