public void CanMapParent()
 {
     var mapdoc = new HbmMapping();
     var component = new HbmNestedCompositeElement();
     var mapper = new ComponentNestedElementMapper(typeof(Number), mapdoc, component, ForClass<Address>.Property(a=> a.Number));
     mapper.Parent(typeof(Address).GetProperty("Parent"));
     component.Parent.Should().Not.Be.Null();
     component.Parent.name.Should().Be.EqualTo("Parent");
 }
 public void CallPropertyMapper()
 {
     var mapdoc = new HbmMapping();
     var component = new HbmNestedCompositeElement();
     var mapper = new ComponentNestedElementMapper(typeof(Number), mapdoc, component, ForClass<Address>.Property(a => a.Number));
     var called = false;
     mapper.Property(ForClass<Number>.Property(a => a.Block), x => called = true);
     called.Should().Be.True();
 }
 public void CanMapNestedComponent()
 {
     var mapdoc = new HbmMapping();
     var component = new HbmNestedCompositeElement();
     var mapper = new ComponentNestedElementMapper(typeof(Number2), mapdoc, component, ForClass<Number>.Property(a => a.NestNumber));
     mapper.Component(ForClass<Number>.Property(a => a.NestNumber), x => { });
     component.Properties.Should().Have.Count.EqualTo(1);
     component.Properties.First().Name.Should().Be.EqualTo("NestNumber");
     component.Properties.First().Should().Be.OfType<HbmNestedCompositeElement>();
 }
        public void CanMapProperty()
        {
            var mapdoc = new HbmMapping();
            var component = new HbmNestedCompositeElement();
            var mapper = new ComponentNestedElementMapper(typeof(Number), mapdoc, component, ForClass<Address>.Property(a => a.Number));

            mapper.Property(ForClass<Number>.Property(a => a.Block), x => { });
            mapper.Property(ForClass<Number>.Property(a => a.Dir), x => { });

            component.Properties.Should().Have.Count.EqualTo(2);
            component.Properties.Select(cp => cp.Name).Should().Have.SameValuesAs("Block", "Dir");
        }
 public void CanSetComponentAccessor()
 {
     var mapdoc = new HbmMapping();
     var component = new HbmNestedCompositeElement();
     var mapper = new ComponentNestedElementMapper(typeof(Number), mapdoc, component, ForClass<Address>.Property(a => a.Number));
     mapper.Access(Accessor.Field);
     component.access.Should().Contain("field");
 }