Example #1
0
        public void RegisterTablePerClass()
        {
            var entitiesTypes = new[] { typeof(MyClass1), typeof(MyClass2) };
            var orm           = new ObjectRelationalMapper();

            orm.TablePerClass(entitiesTypes);
            orm.IsTablePerClass(typeof(MyClass1)).Should().Be(true);
            orm.IsTablePerClass(typeof(MyClass2)).Should().Be(true);

            orm.IsTablePerConcreteClass(typeof(MyClass1)).Should().Be(false);
            orm.IsTablePerClassHierarchy(typeof(MyClass2)).Should().Be(false);
        }
        public void WhenExplicitExcludedThenNotTablePerClass()
        {
            // To prevent inconsistence
            var orm = new ObjectRelationalMapper();
            orm.TablePerClass<ToExcludeImplEntity>();
            orm.Exclude<ToExcludeImplEntity>();

            orm.IsTablePerClass(typeof(ToExcludeImplEntity)).Should().Be.False();
        }
        public void WhenExplicitExcludedThenNotTablePerClass()
        {
            // To prevent inconsistence
            var orm = new ObjectRelationalMapper();

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

            orm.IsTablePerClass(typeof(ToExcludeImplEntity)).Should().Be.False();
        }
 public void IsRecognizedAsTablePerClass()
 {
     mapper.IsTablePerClass(typeof(TestSubEntity)).Should().Be.True();
     mapper.IsTablePerClass(typeof(TestSubSubEntity)).Should().Be.True();
 }
Example #5
0
 public void IsRecognizedAsTablePerClass()
 {
     (typeof(TestEntity)).Satisfy(te => mapper.IsTablePerClass(te));
 }