public CanHandle ( |
||
configuration | The configuration. | |
context | Context | The context. |
Результат | 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); }