public void WhenEntityIsTablePerHierarchyThenMatch()
 {
     var orm = new Mock<IDomainInspector>();
     orm.Setup(x => x.IsTablePerClassHierarchy(typeof(MyClass))).Returns(true);
     var applier = new ClassDiscriminatorValueAsClassNameApplier(orm.Object);
     applier.Match(typeof(MyClass)).Should().Be.True();
 }
Exemplo n.º 2
0
        public void WhenEntityIsTablePerHierarchyThenMatch()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(x => x.IsTablePerClassHierarchy(typeof(MyClass))).Returns(true);
            var applier = new ClassDiscriminatorValueAsClassNameApplier(orm.Object);

            applier.Match(typeof(MyClass)).Should().Be.True();
        }
Exemplo n.º 3
0
        public void AlwaysApplyDicriminatorValueAsClassName()
        {
            var orm     = new Mock <IDomainInspector>();
            var applier = new ClassDiscriminatorValueAsClassNameApplier(orm.Object);

            var mapper = new Mock <IClassAttributesMapper>();

            applier.Apply(typeof(MyClass), mapper.Object);

            mapper.Verify(cm => cm.DiscriminatorValue(It.Is <string>(n => "MyClass".Equals(n))));
        }
        public void AlwaysApplyDicriminatorValueAsClassName()
        {
            var orm = new Mock<IDomainInspector>();
            var applier = new ClassDiscriminatorValueAsClassNameApplier(orm.Object);

            var mapper = new Mock<IClassAttributesMapper>();

            applier.Apply(typeof(MyClass), mapper.Object);

            mapper.Verify(cm=> cm.DiscriminatorValue(It.Is<string>(n=> "MyClass".Equals(n))));
        }