public void Setup() { _handler = new SitecoreLinkedHandler(); _database = global::Sitecore.Configuration.Factory.GetDatabase("master"); _target = _database.GetItem("/sitecore/content/Glass/ItemLinksTest"); SitecoreProperty idProperty = new SitecoreProperty(){ Attribute = new SitecoreIdAttribute(), Property = typeof(SitecoreLinkedHandlerFixtureNS.LinkedTestClass).GetProperty("Id") }; SitecoreIdDataHandler idHandler = new SitecoreIdDataHandler(); idHandler.ConfigureDataHandler(idProperty); var context = new InstanceContext( (new SitecoreClassConfig[]{ new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{ idProperty }, Type = typeof(SitecoreLinkedHandlerFixtureNS.LinkedTestClass), DataHandlers = new AbstractSitecoreDataHandler []{ idHandler } } }).ToDictionary(), new AbstractSitecoreDataHandler[] { }); _service = new SitecoreService(_database, context); }
public void Setup() { _handler = new SitecoreLinkedHandler(); _database = global::Sitecore.Configuration.Factory.GetDatabase("master"); _target = _database.GetItem("/sitecore/content/Data/SitecoreLinkedHandler/Root"); Context context = new Context( new AttributeConfigurationLoader( "Glass.Sitecore.Mapper.Tests.Domain, Glass.Sitecore.Mapper.Tests"), null); _service = new SitecoreService(_database); }