public void WhenMultipleUsageThenMatch() { var orm = GetDomainInspectorMockForBaseTests(); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property1 = new PropertyPath(null, ForClass<Contact>.Property(x => x.CurrentPositions)); applier.Match(property1).Should().Be.True(); var property2 = new PropertyPath(null, ForClass<Contact>.Property(x => x.PastPositions)); applier.Match(property2).Should().Be.True(); }
public void WhenMultipleUsageThenMatch() { var orm = GetDomainInspectorMockForBaseTests(); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property1 = new PropertyPath(null, ConfOrm.ForClass <Contact> .Property(x => x.CurrentPositions)); applier.Match(property1).Should().Be.True(); var property2 = new PropertyPath(null, ConfOrm.ForClass <Contact> .Property(x => x.PastPositions)); applier.Match(property2).Should().Be.True(); }
public void WhenNoPropertyThenNoMatch() { var orm = new Mock <IDomainInspector>(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); pattern.Match(null).Should().Be.False(); }
public void WhenCollectionOfElementsThenNoMatch() { var orm = GetDomainInspectorMock(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ForClass<MyClass>.Property(mc => mc.Elements)); pattern.Match(property).Should().Be.False(); }
public void WhenDictionaryBidirectionalThenNoMatch() { var orm = GetDomainInspectorMock(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ForClass <MyClass> .Property(mc => mc.DicChildren)); pattern.Match(property).Should().Be.False(); }
public void WhenDictionarySeemsBidirectionalWithPropExclusionThenMatch() { var orm = GetDomainInspectorMockWithBidiPropExclusion(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ConfOrm.ForClass <MyClass> .Property(mc => mc.DicChildren)); pattern.Match(property).Should().Be.True(); }
public void WhenCollectionOfElementsThenNoMatch() { var orm = GetDomainInspectorMock(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ConfOrm.ForClass <MyClass> .Property(mc => mc.Elements)); pattern.Match(property).Should().Be.False(); }
public void WhenSingleUsageThenNoMatch() { var orm = GetDomainInspectorMockForBaseTests(); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ForClass<MySingleUsage>.Property(x => x.CurrentPositions)); applier.Match(property).Should().Be.False(); }
public void WhenCollectionUnidirectionalThenMatch() { var orm = GetDomainInspectorMock(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ForClass <MyClass> .Property(mc => mc.Relateds)); pattern.Match(property).Should().Be.True(); }
public void WhenNoPropertyThenNoMatch() { var orm = new Mock <IDomainInspector>(); orm.Setup(x => x.IsPersistentProperty(It.IsAny <MemberInfo>())).Returns(true); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); pattern.Match(null).Should().Be.False(); }
public void WhenSingleUsageThenNoMatch() { var orm = GetDomainInspectorMockForBaseTests(); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ConfOrm.ForClass <MySingleUsage> .Property(x => x.CurrentPositions)); applier.Match(property).Should().Be.False(); }
public void WhenMultipleUsageBehindAComponentThenMatch() { var orm = GetDomainInspectorMockForBaseTests(); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var componentProperty = new PropertyPath(null, ForClass <Contact> .Property(x => x.Component)); var property = new PropertyPath(componentProperty, ForClass <MyComponent> .Property(x => x.PastPositions)); applier.Match(property).Should().Be.True(); }
public void WhenSingleCirsularRelationOnComponentThenNoMatch() { var orm = new Mock <IDomainInspector>(); orm.Setup(x => x.IsPersistentProperty(It.IsAny <MemberInfo>())).Returns(true); orm.Setup(dm => dm.IsOneToMany(typeof(Node), typeof(Node))).Returns(true); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ConfOrm.ForClass <Node> .Property(x => x.Nodes)); applier.Match(property).Should().Be.False(); }
public void WhenSeemsDoubleCirsularRelationOnPolymorphicComponentWithNoPersistentCollectionThenNoMatch() { var orm = new Mock <IDomainInspector>(); orm.Setup(x => x.IsPersistentProperty(It.Is <MemberInfo>(m => !m.Equals(ConfOrm.ForClass <PolyNodeDouble> .Property(y => y.OthersNodes))))).Returns(true); orm.Setup(dm => dm.IsEntity(It.Is <Type>(t => t == typeof(PolyNodeDouble)))).Returns(true); orm.Setup(dm => dm.IsComponent(typeof(INode))).Returns(true); orm.Setup(dm => dm.IsOneToMany(typeof(PolyNodeDouble), typeof(INode))).Returns(true); var applier = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ConfOrm.ForClass <PolyNodeDouble> .Property(x => x.Nodes)); applier.Match(property).Should().Be.False(); }
public void WhenDictionaryUnidirectionalThenMatch() { var orm = GetDomainInspectorMock(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); var property = new PropertyPath(null, ForClass<MyClass>.Property(mc => mc.DicRelateds)); pattern.Match(property).Should().Be.True(); }
public void WhenNoPropertyThenNoMatch() { var orm = new Mock<IDomainInspector>(); var pattern = new UnidirectionalOneToManyMultipleCollectionsKeyColumnApplier(orm.Object); pattern.Match(null).Should().Be.False(); }