public void CallPropertyMapper() { var mapdoc = new HbmMapping(); var compositeId = new HbmCompositeId(); var mapper = new ComposedIdMapper(typeof(Person), compositeId, mapdoc); var called = false; mapper.Property(For<Person>.Property(ts => ts.Email), x => called = true); called.Should().Be.True(); }
public void CanMapProperty() { var mapdoc = new HbmMapping(); var compositeId = new HbmCompositeId(); var mapper = new ComposedIdMapper(typeof(Person), compositeId, mapdoc); mapper.Property(For<Person>.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"); }
public void CanMapProperty() { var mapdoc = new HbmMapping(); var compositeId = new HbmCompositeId(); var mapper = new ComposedIdMapper(typeof(Person), compositeId, mapdoc); mapper.Property(For<Person>.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")); }