public void WhenRelationNotDeclaredAsManyToManyUnidirectionalThenNoMatch() { var orm = new Mock<IDomainInspector>(); var pattern = new ManyToManyPattern(orm.Object); pattern.Match(ForClass<MyClass>.Property(x => x.MyOtherClasses)).Should().Be.False(); pattern.Match(ForClass<MyClass>.Property(x => x.MyBidirects)).Should().Be.False(); pattern.Match(ForClass<MyBidirect>.Property(x => x.MyClasses)).Should().Be.False(); }
public void WhenRelationDeclaredAsManyToManyUnidirectionalThenMatch() { var orm = new Mock<IDomainInspector>(); orm.Setup(x => x.IsManyToMany(It.Is<Type>(t => t == typeof(MyClass)), It.Is<Type>(t => t == typeof(MyOtherClass)))).Returns(true); var pattern = new ManyToManyPattern(orm.Object); pattern.Match(ForClass<MyClass>.Property(x => x.MyOtherClasses)).Should().Be.True(); }
public void WhenRelationNotDeclaredAsManyToManyUnidirectionalThenNoMatch() { var orm = new Mock <IDomainInspector>(); var pattern = new ManyToManyPattern(orm.Object); pattern.Match(ForClass <MyClass> .Property(x => x.MyOtherClasses)).Should().Be.False(); pattern.Match(ForClass <MyClass> .Property(x => x.MyBidirects)).Should().Be.False(); pattern.Match(ForClass <MyBidirect> .Property(x => x.MyClasses)).Should().Be.False(); }
public void WhenRelationDeclaredAsManyToManyForDictionaryValueThenMatch() { var orm = new Mock <IDomainInspector>(); orm.Setup(x => x.IsManyToMany(It.Is <Type>(t => t == typeof(MyClass)), It.Is <Type>(t => t == typeof(MyOtherClass)))).Returns(true); var pattern = new ManyToManyPattern(orm.Object); pattern.Match(ForClass <MyClass> .Property(x => x.MapValue)).Should().Be.True(); }