Пример #1
0
        public void WhenSetExtendsWithWrongBaseTypeThenThrow()
        {
            var subClass = typeof(Inherited);
            var mapdoc   = new HbmMapping {
                assembly = subClass.Assembly.FullName, @namespace = subClass.Namespace
            };
            var mapper = new JoinedSubclassMapper(subClass, mapdoc);

            Executing.This(() => mapper.Extends(typeof(Z))).Should().Throw <ArgumentOutOfRangeException>();
            Executing.This(() => mapper.Extends(typeof(Inherited2))).Should().Throw <ArgumentOutOfRangeException>();
        }
Пример #2
0
        public void WhenSetExtendsExplicitlyThenSetDifferentBaseType()
        {
            var subClass = typeof(Inherited2);
            var mapdoc   = new HbmMapping {
                assembly = subClass.Assembly.FullName, @namespace = subClass.Namespace
            };
            var mapper = new JoinedSubclassMapper(subClass, mapdoc);

            mapper.Extends(typeof(EntitySimple));
            mapdoc.JoinedSubclasses[0].extends.Should().Be.EqualTo(typeof(EntitySimple).Name);
        }