public void WhenDoubleRegistrationThenNotThrows() { var orm = new ObjectRelationalMapper(); orm.Bidirectional <B, A>(b => b.Generic, a => a.Bag); orm.Executing(o => o.Bidirectional <B, A>(b => b.Generic, a => a.Bag)).NotThrows(); }
public void WhenAmbiguousRegistrationThenThrows() { var orm = new ObjectRelationalMapper(); orm.Bidirectional <A, B>(a => a.Bag, b => b.A); orm.Executing(o => o.Bidirectional <A, B>(a => a.Bag, b => b.Generic)).Throws <MappingException>() .And.ValueOf.Message.ToLowerInvariant().Should().Contain("ambiguous"); }
public void WhenRegisterNullThenThrows() { var orm = new ObjectRelationalMapper(); orm.Executing(o => o.Complex(null)).Throws <ArgumentNullException>(); }