Пример #1
0
        public void RegisterTablePerConcreteClass()
        {
            var entitiesTypes = new[] { typeof(MyClass1), typeof(MyClass2) };
            var orm           = new ObjectRelationalMapper();

            orm.TablePerConcreteClass(entitiesTypes);
            orm.IsTablePerConcreteClass(typeof(MyClass1)).Should().Be(true);
            orm.IsTablePerConcreteClass(typeof(MyClass2)).Should().Be(true);

            orm.IsTablePerClass(typeof(MyClass1)).Should().Be(false);
            orm.IsTablePerClassHierarchy(typeof(MyClass2)).Should().Be(false);
        }
        public void WhenExplicitExcludedThenNotTablePerConcreteClass()
        {
            // To prevent inconsistence
            var orm = new ObjectRelationalMapper();

            orm.TablePerConcreteClass <ToExcludeImplEntity>();
            orm.Exclude <ToExcludeImplEntity>();

            orm.IsTablePerConcreteClass(typeof(ToExcludeImplEntity)).Should().Be.False();
        }
        public void WhenExplicitExcludedThenNotTablePerConcreteClass()
        {
            // To prevent inconsistence
            var orm = new ObjectRelationalMapper();
            orm.TablePerConcreteClass<ToExcludeImplEntity>();
            orm.Exclude<ToExcludeImplEntity>();

            orm.IsTablePerConcreteClass(typeof(ToExcludeImplEntity)).Should().Be.False();
        }
 public void IsNotRecognizedAsTablePerConcreteClass()
 {
     (typeof(TestSubEntity)).Satisfy(te => !mapper.IsTablePerConcreteClass(te));
     (typeof(TestSubSubEntity)).Satisfy(te => !mapper.IsTablePerConcreteClass(te));
 }