public void Setup() { _handler = new SitecoreFieldClassHandler(); Context context = new Context( new AttributeConfigurationLoader( "Glass.Sitecore.Mapper.Tests.Data.SitecoreChildrenHandlerFixture, Glass.Sitecore.Mapper.Tests", "Glass.Sitecore.Mapper.Tests.Domain, Glass.Sitecore.Mapper.Tests")); _db = global::Sitecore.Configuration.Factory.GetDatabase("master"); _service = new SitecoreService(_db); _item1Path = "/sitecore/content/Data/SitecoreFieldClassHandler/Item1"; _item2Path = "/sitecore/content/Data/SitecoreFieldClassHandler/Item2"; }
public void Setup() { _handler = new SitecoreFieldClassHandler(); var loadedClassIdProperty = new SitecoreProperty() { Attribute = new SitecoreIdAttribute(), Property = typeof(SitecoreFieldClassHandlerFixtureNS.LoadedClass).GetProperty("Id") }; var baseTypeIdProperty = new SitecoreProperty() { Attribute = new SitecoreIdAttribute(), Property = typeof(SitecoreFieldClassHandlerFixtureNS.BaseType).GetProperty("Id") }; var context = new InstanceContext( (new SitecoreClassConfig[]{ new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{ loadedClassIdProperty }, Type = typeof(SitecoreFieldClassHandlerFixtureNS.LoadedClass), DataHandlers = new AbstractSitecoreDataHandler[]{}, IdProperty = loadedClassIdProperty }, new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{ baseTypeIdProperty }, IdProperty= baseTypeIdProperty, Type = typeof(SitecoreFieldClassHandlerFixtureNS.BaseType), DataHandlers = new AbstractSitecoreDataHandler []{ new SitecoreIdDataHandler(){ Property = typeof(SitecoreFieldClassHandlerFixtureNS.BaseType).GetProperty("Id") } } }, new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(){ }, Properties = new SitecoreProperty[]{ new SitecoreProperty(){ Attribute = new SitecoreIdAttribute(), Property = typeof(SitecoreFieldClassHandlerFixtureNS.TypeOne).GetProperty("Id") } }, Type = typeof(SitecoreFieldClassHandlerFixtureNS.TypeOne), DataHandlers = new AbstractSitecoreDataHandler []{ new SitecoreIdDataHandler(){ Property = typeof(SitecoreFieldClassHandlerFixtureNS.TypeOne).GetProperty("Id") } }, TemplateId = new Guid("{1D0EE1F5-21E0-4C5B-8095-EDE2AF3D3300}") }, }).ToDictionary(), new AbstractSitecoreDataHandler[] { } ); _db = global::Sitecore.Configuration.Factory.GetDatabase("master"); _service = new SitecoreService(_db, context); // /sitecore/content/Glass/Test2 _itemId = new Guid("{8A317CBA-81D4-4F9E-9953-64C4084AECCA}"); }