Exemplo n.º 1
0
        public void CallPropertyMapper()
        {
            var mapdoc      = new HbmMapping();
            var compositeId = new HbmCompositeId();
            var mapper      = new ComponentAsIdMapper(typeof(PersonId), For <Person> .Property(x => x.Id), compositeId, mapdoc);
            var called      = false;

            mapper.Property(For <PersonId> .Property(ts => ts.Email), x => called = true);

            called.Should().Be.True();
        }
Exemplo n.º 2
0
        public void CanMapProperty()
        {
            var mapdoc      = new HbmMapping();
            var compositeId = new HbmCompositeId();
            var mapper      = new ComponentAsIdMapper(typeof(PersonId), For <Person> .Property(x => x.Id), compositeId, mapdoc);

            mapper.Property(For <PersonId> .Property(ts => ts.Email), x => { });

            compositeId.Items.Should().Have.Count.EqualTo(1);
            compositeId.Items.First().Should().Be.OfType <HbmKeyProperty>();
            compositeId.Items.OfType <HbmKeyProperty>().First().Name.Should().Be.EqualTo("Email");
        }
Exemplo n.º 3
0
        public void CanMapProperty()
        {
            var mapdoc      = new HbmMapping();
            var compositeId = new HbmCompositeId();
            var mapper      = new ComponentAsIdMapper(typeof(PersonId), For <Person> .Property(x => x.Id), compositeId, mapdoc);

            mapper.Property(For <PersonId> .Property(ts => ts.Email), x => { });

            Assert.That(compositeId.Items, Has.Length.EqualTo(1));
            Assert.That(compositeId.Items.First(), Is.TypeOf <HbmKeyProperty>());
            Assert.That(compositeId.Items.OfType <HbmKeyProperty>().First().Name, Is.EqualTo("Email"));
        }