public void WhenMapOneToManyRelationshipThenCallAction() { var hbm = new CollectionElementRelation(typeof(Address), new HbmMapping(), element => { }); bool called = false; hbm.OneToMany(x => called = true); called.Should().Be.True(); }
public void AssignElementRelationship() { object relationField = null; var hbm = new CollectionElementRelation(typeof(Address), new HbmMapping(), element => relationField = element); hbm.Element(x => { }); relationField.Should().Not.Be.Null().And.Be.OfType <HbmElement>().And.ValueOf.Type.Satisfy( a => !string.IsNullOrEmpty(a.name)); }
public void AssignComponentRelationship() { object relationField = null; var hbm = new CollectionElementRelation(typeof(Address), new HbmMapping(), element => relationField = element); hbm.Component(comp => { }); relationField.Should().Not.Be.Null().And.Be.OfType <HbmCompositeElement>()[email protected]( a => !string.IsNullOrEmpty(a)); }
public void AssignManyToManyRelationship() { object relationField = null; var hbm = new CollectionElementRelation <Address>(new HbmMapping(), element => relationField = element); hbm.ManyToMany(); relationField.Should().Not.Be.Null().And.Be.OfType <HbmManyToMany>()[email protected]( a => !string.IsNullOrEmpty(a)); }