Example #1
0
        public void CallMapManyToOneMapper()
        {
            var mapdoc    = new HbmMapping();
            var component = new HbmCompositeMapKey();
            var mapper    = new ComponentMapKeyMapper(typeof(ToySkill), component, mapdoc);
            var called    = false;

            mapper.ManyToOne(ForClass <ToySkill> .Property(ts => ts.Skill), x => called = true);

            called.Should().Be.True();
        }
Example #2
0
        public void CanMapManyToOne()
        {
            var mapdoc    = new HbmMapping();
            var component = new HbmCompositeMapKey();
            var mapper    = new ComponentMapKeyMapper(typeof(ToySkill), component, mapdoc);

            mapper.ManyToOne(ForClass <ToySkill> .Property(ts => ts.Skill), x => { });

            component.Properties.Should().Have.Count.EqualTo(1);
            component.Properties.First().Name.Should().Be.EqualTo("Skill");
            component.Properties.First().Should().Be.OfType <HbmKeyManyToOne>();
        }