예제 #1
0
        public void WhenForceClassRelationToIncompatibleTypeThenThrows()
        {
            var hbm    = new HbmOneToMany();
            var mapper = new OneToManyMapper(typeof(IMyInterface), hbm, null);

            Executing.This(() => mapper.Class(typeof(Whatever))).Should().Throw <ArgumentOutOfRangeException>();
        }
예제 #2
0
        public void CanForceClassRelation()
        {
            var hbm    = new HbmOneToMany();
            var mapper = new OneToManyMapper(typeof(IMyInterface), hbm, null);

            mapper.Class(typeof(MyClass));

            hbm.Class.Should().Contain("MyClass").And.Not.Contain("IMyInterface");
        }