public void CallMapManyToOneMapper() { var mapdoc = new HbmMapping(); var compositeId = new HbmCompositeId(); var mapper = new ComposedIdMapper(typeof(Person), compositeId, mapdoc); var called = false; mapper.ManyToOne(For<Person>.Property(ts => ts.User), x => called = true); called.Should().Be.True(); }
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); Assert.That(called, Is.True); }
public void CanMapManyToOne() { var mapdoc = new HbmMapping(); var compositeId = new HbmCompositeId(); var mapper = new ComposedIdMapper(typeof(Person), compositeId, mapdoc); mapper.ManyToOne(For<Person>.Property(ts => ts.User), x => { }); compositeId.Items.Should().Have.Count.EqualTo(1); compositeId.Items.First().Should().Be.OfType<HbmKeyManyToOne>(); compositeId.Items.OfType<HbmKeyManyToOne>().First().Name.Should().Be.EqualTo("User"); }
public void CanMapManyToOne() { var mapdoc = new HbmMapping(); var compositeId = new HbmCompositeId(); var mapper = new ComposedIdMapper(typeof(Person), compositeId, mapdoc); mapper.ManyToOne(For<Person>.Property(ts => ts.User), x => { }); Assert.That(compositeId.Items, Has.Length.EqualTo(1)); Assert.That(compositeId.Items.First(), Is.TypeOf<HbmKeyManyToOne>()); Assert.That(compositeId.Items.OfType<HbmKeyManyToOne>().First().Name, Is.EqualTo("User")); }