public void CanHandle_CorrectConfigNotMappedClass_ReturnsTrueOnDemand() { //Assign var mapper = new SitecoreQueryMapper(null); var config = new SitecoreQueryConfiguration(); config.PropertyInfo = new FakePropertyInfo(typeof(StubNotMapped)); 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_IncorrectConfigMappedClass_ReturnsFalse() { //Assign var mapper = new SitecoreQueryMapper(null); var config = new SitecoreFieldConfiguration(); config.PropertyInfo = typeof(StubClass).GetProperty("StubMapped"); 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); }
public void CanHandle_CorrectConfigNotMappedClass_ReturnsTrueOnDemand() { //Assign var mapper = new SitecoreQueryMapper(null); var config = new SitecoreQueryConfiguration(); config.PropertyInfo = typeof(StubClass).GetProperty("StubNotMapped"); var context = Context.Create(Utilities.CreateStandardResolver()); context.Load(new OnDemandLoader <SitecoreTypeConfiguration>(typeof(StubClass))); //Act var result = mapper.CanHandle(config, context); //Assert Assert.IsTrue(result); }