コード例 #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");
        }