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 SitecoreIdDataHandler();
     _itemId = new Guid("{8A317CBA-81D4-4F9E-9953-64C4084AECCA}");
     _db = global::Sitecore.Configuration.Factory.GetDatabase("master");
 }
        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}");
                
        }