예제 #1
0
        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();
        }
예제 #2
0
        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");
        }
예제 #3
0
        public void WhenRegisterNullThenThrows()
        {
            var orm = new ObjectRelationalMapper();

            orm.Executing(o => o.Complex(null)).Throws <ArgumentNullException>();
        }