public void WhenCustomizeAccessorThenIgnore() { var mapdoc = new HbmMapping(); var component = new HbmDynamicComponent(); var mapper = new DynamicComponentMapper(component, For<Person>.Property(p => p.Info), mapdoc); var propertyInfo = (new { A = (IDictionary<int, int>)null }).GetType().GetProperty("A"); mapper.Map(propertyInfo, x => x.Access(Accessor.Field), km => { }, rel => { }); component.Properties.OfType<HbmMap>().Single().Access.Should().Be.NullOrEmpty(); }
public void WhenAddThenHas() { var mapdoc = new HbmMapping(); var component = new HbmDynamicComponent(); var mapper = new DynamicComponentMapper(component, For<Person>.Property(p => p.Info), mapdoc); var propertyInfo = (new { A = (IDictionary<int, int>)null }).GetType().GetProperty("A"); mapper.Map(propertyInfo, x => { }, km => { }, rel => { }); component.Properties.Select(x => x.Name).Should().Have.SameSequenceAs("A"); }
public void WhenAddThenHas() { var mapdoc = new HbmMapping(); var component = new HbmDynamicComponent(); var mapper = new DynamicComponentMapper(component, For<Person>.Property(p => p.Info), mapdoc); var propertyInfo = (new { A = (IDictionary<int, int>)null }).GetType().GetProperty("A"); mapper.Map(propertyInfo, x => { }, km => { }, rel => { }); Assert.That(component.Properties.Select(x => x.Name), Is.EquivalentTo(new[] { "A" })); }
public void WhenCustomizeThenCallCustomizer() { var mapdoc = new HbmMapping(); var component = new HbmDynamicComponent(); var mapper = new DynamicComponentMapper(component, For<Person>.Property(p => p.Info), mapdoc); var propertyInfo = (new { A = (IDictionary<int, int>)null }).GetType().GetProperty("A"); var called = false; mapper.Map(propertyInfo, x => called = true, km => { }, rel => { }); called.Should().Be.True(); }