public void Setup() { _db = global::Sitecore.Configuration.Factory.GetDatabase("master"); _itemId = new Guid("{8A317CBA-81D4-4F9E-9953-64C4084AECCA}"); _handler = new SitecoreFieldStringHandler(); _item = _db.GetItem(new ID(_itemId)); _richTextOriginal = _item["RichText"]; using (new SecurityDisabler()) { _item.Editing.BeginEdit(); _item["RichText"] = _richTextContent; _item.Editing.EndEdit(); } }
public void Setup() { #region TestClass1 var tc1Property = new SitecoreProperty() { Attribute = new SitecoreIdAttribute(), Property = typeof(InstanceContextFixtureNS.TestClass).GetProperty("Id") }; var tc1HandlerId = new SitecoreIdDataHandler(); tc1HandlerId.ConfigureDataHandler(tc1Property); #endregion #region TestClass4 var tc4Property = new SitecoreProperty() { Attribute = new SitecoreFieldAttribute(), Property = typeof(InstanceContextFixtureNS.TestClass4).GetProperty("SingleLineText") }; var tc4HandlerString = new SitecoreFieldStringHandler(); tc4HandlerString.ConfigureDataHandler(tc4Property); #endregion var context = new InstanceContext((new SitecoreClassConfig[]{ new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{ tc1Property }, Type = typeof(InstanceContextFixtureNS.TestClass), DataHandlers = new AbstractSitecoreDataHandler[]{ tc1HandlerId }, IdProperty = tc1Property }, new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{}, Type = typeof(InstanceContextFixtureNS.TestClass2), DataHandlers = new AbstractSitecoreDataHandler[]{} }, new SitecoreClassConfig(){ ClassAttribute = new SitecoreClassAttribute(), Properties = new SitecoreProperty[]{ tc4Property }, Type = typeof(InstanceContextFixtureNS.TestClass4), DataHandlers = new AbstractSitecoreDataHandler[]{tc4HandlerString} } }).ToDictionary(), new AbstractSitecoreDataHandler[] { }); _db = global::Sitecore.Configuration.Factory.GetDatabase("master"); _service = new SitecoreService(_db, context); _itemId = new Guid("{8A317CBA-81D4-4F9E-9953-64C4084AECCA}"); _itemId2 = new Guid("{BD193B3A-D3CA-49B4-BF7A-2A61ED77F19D}"); }