CreateStandardResolver() public static method

public static CreateStandardResolver ( ) : Glass.Mapper.IoC.IDependencyResolver
return Glass.Mapper.IoC.IDependencyResolver
Beispiel #1
0
        public void InterfaceIssueInPageEditorWhenInterfaceInheritsFromAnInterfaceWithSimilarName()
        {
            /*
             * This test is in response to issue 53 raised on the Glass.Sitecore.Mapper
             * project. When two interfaces have similar names are created as proxies
             * the method GetTypeConfiguration returns the wrong config.
             */

            //Assign
            var context = Context.Create(Utilities.CreateStandardResolver());

            context.Load(new SitecoreAttributeConfigurationLoader("Glass.Mapper.Sc.Integration"));

            var db        = Factory.GetDatabase("master");
            var scContext = new SitecoreContext(db);

            var glassHtml = new GlassHtml(scContext);
            var instance  = scContext.GetItem <IBasePage>("/sitecore");

            //Act
            glassHtml.Editable(instance, x => x.Title);

            //This method should execute without error
        }
        public void Setup()
        {
            if (_hasRun)
            {
                return;
            }
            else
            {
                _hasRun = true;
            }

            _glassWatch = new Stopwatch();
            _rawWatch   = new Stopwatch();


            _expected = "hello world";
            _id       = new Guid("{59784F74-F830-4BCD-B1F0-1A08616EF726}");

            _context = Context.Create(Utilities.CreateStandardResolver());


            _context.Load(new SitecoreAttributeConfigurationLoader("Glass.Mapper.Sc.Integration"));

            _db = Sitecore.Configuration.Factory.GetDatabase("master");

            //       service.Profiler = new SimpleProfiler();

            _service = new SitecoreService(_db);

            var item = _db.GetItem(new ID(_id));

            using (new ItemEditing(item, true))
            {
                item["Field"] = _expected;
            }
        }