Ejemplo n.º 1
0
        public void CanHandle_ConfigIsNodeAndClassNotMapped_ReturnsTrueOndemand()
        {
            //Assign
            var config = new SitecoreNodeConfiguration();
            var context = Context.Create(Utilities.CreateStandardResolver());
            var mapper = new SitecoreItemMapper();

            config.PropertyInfo = typeof (Stub).GetProperty("StubNotMapped");
            context.Load(new SitecoreAttributeConfigurationLoader("Glass.Mapper.Sc.Integration"));

            //Act
            var result = mapper.CanHandle(config, context);

            //Assert
            Assert.IsTrue(result);
        }
        public void CanHandle_ConfigIsNotNodeAndClassMapped_ReturnsTrue()
        {
            //Assign
            var config = new SitecoreFieldConfiguration();
            var context = Context.Create(Utilities.CreateStandardResolver());
            var mapper = new SitecoreItemMapper();

            config.PropertyInfo = new FakePropertyInfo(typeof(StubMapped));
            context.Load(new SitecoreAttributeConfigurationLoader("Glass.Mapper.Sc.Integration"));

            //Act
            var result = mapper.CanHandle(config, context);

            //Assert
            Assert.IsFalse(result);
        }