Exemplo n.º 1
0
        public void WhenNoRelationWithComponentThenMatch()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(orm.Object);

            pattern.Match(ForClass <MyComponent> .Property(p => p.Strings)).Should().Be.True();
        }
Exemplo n.º 2
0
        public void WhenNoGenericCollectionThenNoMatch()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(orm.Object);

            pattern.Match(ForClass <MyClass> .Property(p => p.Something)).Should().Be.False();
        }
        public void WhenNoRelationWithComponentThenMatch()
        {
            var orm = new Mock<IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(orm.Object);

            pattern.Match(ForClass<MyComponent>.Property(p => p.Strings)).Should().Be.True();
        }
Exemplo n.º 4
0
        public void WhenNoRelationBetweenEntitiesThenMatch()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(orm.Object);

            pattern.Match(ForClass <MyClass> .Property(p => p.Strings)).Should().Be.True();
            pattern.Match(ForClass <MyClass> .Property(p => p.MapOfStrings)).Should().Be.True();
        }
        public void WhenRelationIsOneToManyInsideComponentThenNoMatch()
        {
            var orm = new Mock<IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(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 WhenRelationIsForMapKeyThenMatch()
        {
            var orm = new Mock<IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(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.MapRelationOnKey)).Should().Be.True();
        }
        public void WhenNoRelationBetweenEntitiesThenMatch()
        {
            var orm = new Mock<IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(orm.Object);

            pattern.Match(ForClass<MyClass>.Property(p => p.Strings)).Should().Be.True();
            pattern.Match(ForClass<MyClass>.Property(p => p.MapOfStrings)).Should().Be.True();
        }
Exemplo n.º 8
0
        public void WhenRelationIsOneToManyInsideComponentThenNoMatch()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(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();
        }
Exemplo n.º 9
0
        public void WhenRelationIsForMapKeyThenMatch()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new CollectionOfElementsPattern(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.MapRelationOnKey)).Should().Be.True();
        }
 public void WhenNoGenericCollectionThenNoMatch()
 {
     var orm = new Mock<IDomainInspector>();
     var pattern = new CollectionOfElementsPattern(orm.Object);
     pattern.Match(ForClass<MyClass>.Property(p => p.Something)).Should().Be.False();
 }