public void WhenRelationIsElementsThenNoMatch() { var orm = new Mock <IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); pattern.Match(ForClass <MyClass> .Property(p => p.Elements)).Should().Be.False(); }
public void WhenNoGenericCollectionThenNoMatch() { var orm = new Mock <IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); pattern.Match(ForClass <MyClass> .Property(p => p.Something)).Should().Be.False(); }
public void WhenRelationIsElementsThenNoMatch() { var orm = new Mock<IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); pattern.Match(ForClass<MyClass>.Property(p => p.Elements)).Should().Be.False(); }
public void WhenRelationIsManyToManyThenNoMatch() { var orm = new Mock<IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); orm.Setup(x => x.IsManyToMany(It.Is<Type>(t => t == typeof(MyClass)), It.Is<Type>(t => t == typeof(MyRelated)))).Returns(true); pattern.Match(ForClass<MyClass>.Property(p => p.Relateds)).Should().Be.False(); }
public void WhenComponentsCollectionThenMatch() { var orm = new Mock<IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); orm.Setup(x => x.IsComponent(typeof(MyComponent))).Returns(true); pattern.Match(ForClass<MyClass>.Property(p => p.Components)).Should().Be.True(); }
public void WhenRelationIsOneToManyInsideComponentThenNoMatch() { var orm = new Mock <IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); orm.Setup(x => x.IsOneToMany(It.Is <Type>(t => t == typeof(MyComponent)), It.Is <Type>(t => t == typeof(MyRelated)))).Returns(true); pattern.Match(ForClass <MyComponent> .Property(p => p.Relateds)).Should().Be.False(); }
public void WhenComponentsCollectionInsideComponentThenMatch() { var orm = new Mock <IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); orm.Setup(x => x.IsComponent(typeof(MyComponent))).Returns(true); pattern.Match(ForClass <MyComponent> .Property(p => p.Components)).Should().Be.True(); }
public void WhenNoGenericCollectionThenNoMatch() { var orm = new Mock<IDomainInspector>(); var pattern = new CollectionOfComponentsPattern(orm.Object); pattern.Match(ForClass<MyClass>.Property(p => p.Something)).Should().Be.False(); }