public void NoMatchManyToManyInDictionaryValue()
 {
     var orm = new Mock<IDomainInspector>();
     orm.Setup(o => o.IsManyToMany(It.IsAny<Type>(), It.IsAny<Type>())).Returns(true);
     var pattern = new BidirectionalOneToManyPattern(orm.Object);
     pattern.Match(new Relation(typeof(HumanValue), typeof(HumanValue))).Should().Be.False();
 }
예제 #2
0
        public void MatchOneToManyInDictionaryValue()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new BidirectionalOneToManyPattern(orm.Object);

            pattern.Match(new Relation(typeof(HumanValue), typeof(HumanValue))).Should().Be.False();
        }
예제 #3
0
        public void NoMatchManyToOne()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new BidirectionalOneToManyPattern(orm.Object);

            pattern.Match(new Relation(typeof(Child), typeof(Parent))).Should().Be.False();
        }
예제 #4
0
        public void MatchOneToManyInDictionaryValue()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(x => x.IsPersistentProperty(It.IsAny <MemberInfo>())).Returns(true);
            var pattern = new BidirectionalOneToManyPattern(orm.Object);

            pattern.Match(new Relation(typeof(HumanValue), typeof(HumanValue))).Should().Be.False();
        }
예제 #5
0
        public void NoMatchManyToManyInDictionaryValue()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(o => o.IsManyToMany(It.IsAny <Type>(), It.IsAny <Type>())).Returns(true);
            var pattern = new BidirectionalOneToManyPattern(orm.Object);

            pattern.Match(new Relation(typeof(HumanValue), typeof(HumanValue))).Should().Be.False();
        }
예제 #6
0
        public void WhenParentPropExclusionThenNoMatch()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(x => x.IsPersistentProperty(It.IsAny <MemberInfo>())).Returns(true);
            orm.Setup(x => x.IsPersistentProperty(It.Is <MemberInfo>(p => ForClass <Child> .Property(c => c.Parent).Equals(p)))).Returns(false);
            var pattern = new BidirectionalOneToManyPattern(orm.Object);

            pattern.Match(new Relation(typeof(Parent), typeof(Child))).Should().Be.False();
        }
예제 #7
0
        public void NoMatchManyToMany()
        {
            var orm = new Mock <IDomainInspector>();

            orm.Setup(x => x.IsPersistentProperty(It.IsAny <MemberInfo>())).Returns(true);
            orm.Setup(o => o.IsManyToMany(It.IsAny <Type>(), It.IsAny <Type>())).Returns(true);
            var pattern = new BidirectionalOneToManyPattern(orm.Object);

            pattern.Match(new Relation(typeof(Child), typeof(Parent))).Should().Be.False();
            pattern.Match(new Relation(typeof(Parent), typeof(Child))).Should().Be.False();
        }
 public void NoMatchManyToOne()
 {
     var orm = new Mock<IDomainInspector>();
     var pattern = new BidirectionalOneToManyPattern(orm.Object);
     pattern.Match(new Relation(typeof(Child), typeof(Parent))).Should().Be.False();
 }
 public void MatchOneToManyInDictionaryValue()
 {
     var orm = new Mock<IDomainInspector>();
     var pattern = new BidirectionalOneToManyPattern(orm.Object);
     pattern.Match(new Relation(typeof(HumanValue), typeof(HumanValue))).Should().Be.False();
 }