public void Setup() { _handler = new SitecoreItemHandler(); var db = global::Sitecore.Configuration.Factory.GetDatabase("master"); Context context = new Context( new AttributeConfigurationLoader( "Glass.Sitecore.Mapper.Tests.Domain, Glass.Sitecore.Mapper.Tests")); _service = new SitecoreService(db); }
public void Setup() { _handler = new SitecoreItemHandler(); var db = global::Sitecore.Configuration.Factory.GetDatabase("master"); var testTypeIdProperty = new SitecoreProperty() { Attribute = new SitecoreIdAttribute(), Property = typeof(SitecoreItemHandlerFixtureNS.TestClass).GetProperty("Id") }; var context = new InstanceContext( (new SitecoreClassConfig[]{ new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{ testTypeIdProperty }, IdProperty= testTypeIdProperty, Type = typeof(SitecoreItemHandlerFixtureNS.TestClass), DataHandlers = new AbstractSitecoreDataHandler []{ new SitecoreIdDataHandler(){ Property = typeof(SitecoreItemHandlerFixtureNS.TestClass).GetProperty("Id") }, new SitecoreInfoHandler(){ Property = typeof(SitecoreItemHandlerFixtureNS.TestClass).GetProperty("Path"), InfoType = SitecoreInfoType.Path }, } } }).ToDictionary(), new AbstractSitecoreDataHandler[] { }); _service = new SitecoreService(db, context); }