CanHandle() public method

Indicates that the data mapper will mapper to and from the property
public CanHandle ( AbstractPropertyConfiguration configuration, Context context ) : bool
configuration Glass.Mapper.Configuration.AbstractPropertyConfiguration The configuration.
context Context The context.
return bool
        public void CanHandle_IsEnumerableOfMappedClassWithLinkedConfig_ReturnsTrue()
        {
            //Assign
            var config = new SitecoreLinkedConfiguration();
            config.PropertyInfo = new FakePropertyInfo(typeof(IEnumerable<StubMapped>));
            var mapper = new SitecoreLinkedMapper();
            var context = Context.Create(Utilities.CreateStandardResolver());
            context.Load(new SitecoreAttributeConfigurationLoader("Glass.Mapper.Sc.Integration"));


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

        }
        public void CanHandle_IsEnumerableOfMappedClassWithLinkedConfig_ReturnsTrue()
        {
            //Assign
            var config = new SitecoreLinkedConfiguration();
            config.PropertyInfo = typeof(StubClass).GetProperty("StubMappeds");

            var mapper = new SitecoreLinkedMapper();
            var context = Context.Create(Utilities.CreateStandardResolver());
            context.Load(new OnDemandLoader<SitecoreTypeConfiguration>(typeof(StubClass)));



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

            //Assert
            Assert.IsTrue(result);

        }
        public void CanHandle_IsListOfMappedClassWithLinkedConfig_ReturnsFalse()
        {
            //Assign
            var config = new SitecoreLinkedConfiguration();
            config.PropertyInfo = typeof (StubClass).GetProperty("StubMappedsList");

            var mapper = new SitecoreLinkedMapper();
            var context = Context.Create(Utilities.CreateStandardResolver());
            context.Load(new SitecoreAttributeConfigurationLoader("Glass.Mapper.Sc.Integration"));


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

            //Assert
            Assert.IsFalse(result);

        }