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

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

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

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

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