public void NoMatchManyToMany() { 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(Child), typeof(Parent))).Should().Be.False(); pattern.Match(new Relation(typeof(Parent), typeof(Child))).Should().Be.False(); }
public void NoMatchManyToMany() { 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(Child), typeof(Parent))).Should().Be.False(); pattern.Match(new Relation(typeof(Parent), typeof(Child))).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(); }
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>(); 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(); }
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(); }
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(); }