public void WhenEntityIsTablePerHierarchyThenMatch()
 {
     var orm = new Mock<IDomainInspector>();
     orm.Setup(x => x.IsTablePerClassHierarchy(typeof(Item))).Returns(true);
     IPatternApplier<Type, IClassAttributesMapper> applier = new ClassDiscriminatorValueAsEnumValueApplier<Item, EntitiesTypes>(orm.Object);
     applier.Match(typeof(Item)).Should().Be.True();
 }
 public void WhenEntityIsTablePerHierarchyButOutsideTheDefinedHierarchyThenNoMatch()
 {
     var orm = new Mock<IDomainInspector>();
     orm.Setup(x => x.IsTablePerClassHierarchy(typeof(Item))).Returns(true);
     orm.Setup(x => x.IsTablePerClassHierarchy(typeof(SomethingOutOfHierarchy))).Returns(true);
     var applier = new ClassDiscriminatorValueAsEnumValueApplier<Item, EntitiesTypes>(orm.Object);
     applier.Match(typeof(SomethingOutOfHierarchy)).Should().Be.False();
 }
Ejemplo n.º 3
0
        public void WhenEntityIsTablePerHierarchyThenMatch()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(x => x.IsTablePerClassHierarchy(typeof(Item))).Returns(true);
            IPatternApplier <Type, IClassAttributesMapper> applier = new ClassDiscriminatorValueAsEnumValueApplier <Item, EntitiesTypes>(orm.Object);

            applier.Match(typeof(Item)).Should().Be.True();
        }
Ejemplo n.º 4
0
        public void WhenEntityIsTablePerHierarchyButOutsideTheDefinedHierarchyThenNoMatch()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(x => x.IsTablePerClassHierarchy(typeof(Item))).Returns(true);
            orm.Setup(x => x.IsTablePerClassHierarchy(typeof(SomethingOutOfHierarchy))).Returns(true);
            var applier = new ClassDiscriminatorValueAsEnumValueApplier <Item, EntitiesTypes>(orm.Object);

            applier.Match(typeof(SomethingOutOfHierarchy)).Should().Be.False();
        }