public CanHandle ( |
||
configuration | The configuration. | |
context | Context | The context. |
리턴 | bool |
public void CanHandle_CorrectConfigIEnumerableNotMappedClass_ReturnsTrueOnDemand() { //Assign var mapper = new SitecoreQueryMapper(null); var config = new SitecoreQueryConfiguration(); config.PropertyInfo = new FakePropertyInfo(typeof(IEnumerable<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_CorrectConfigIEnumerableMappedClass_ReturnsTrue() { //Assign var mapper = new SitecoreQueryMapper(null); var config = new SitecoreQueryConfiguration(); config.PropertyInfo = typeof(StubClass).GetProperty("StubMappeds"); 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_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); }