예제 #1
0
        public void CanSetParentAccessor()
        {
            var mapdoc    = new HbmMapping();
            var component = new HbmComponent();
            var mapper    = new ComponentMapper(component, typeof(Name), ConfOrm.ForClass <Person> .Property(p => p.Name), mapdoc);

            mapper.Parent(typeof(Address).GetProperty("Parent"), pm => pm.Access(Accessor.Field));
            component.Parent.access.Should().Contain("field");
        }
예제 #2
0
        public void CallingParentSetTheParentNode()
        {
            var mapdoc    = new HbmMapping();
            var component = new HbmComponent();
            var mapper    = new ComponentMapper(component, typeof(Name), ConfOrm.ForClass <Person> .Property(p => p.Name), mapdoc);

            mapper.Parent(typeof(Address).GetProperty("Parent"));
            component.Parent.Should().Not.Be.Null();
            component.Parent.name.Should().Be.EqualTo("Parent");
        }