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

            var mapper = new Mock <ICollectionPropertiesMapper>();
            var path   = new PropertyPath(null, ForClass <MyClass> .Property(p => p.MapOfStrings));

            pattern.Match(path).Should().Be.True();
            pattern.Apply(path, mapper.Object);
            mapper.Verify(km => km.Table(It.Is <string>(s => s == "MyClassMapOfStrings")));
        }
        public void WhenDictionaryIsInPlainEntityThenApplyClassNamePropertyName()
        {
            var orm = new Mock<IDomainInspector>();
            var pattern = new CollectionOfElementsTableApplier(orm.Object);

            var mapper = new Mock<ICollectionPropertiesMapper>();
            var path = new PropertyPath(null, ForClass<MyClass>.Property(p => p.MapOfStrings));

            pattern.Match(path).Should().Be.True();
            pattern.Apply(path, mapper.Object);
            mapper.Verify(km => km.Table(It.Is<string>(s => s == "MyClassMapOfStrings")));
        }
Exemplo n.º 3
0
        public void WhenRelationIsOneToManyInsideComponentThenApplyClassNameComponentPropertyNamePropertyName()
        {
            var orm     = new Mock <IDomainInspector>();
            var pattern = new CollectionOfElementsTableApplier(orm.Object);

            var mapper = new Mock <ICollectionPropertiesMapper>();
            var level0 = new PropertyPath(null, ForClass <MyClass> .Property(p => p.Component));
            var path   = new PropertyPath(level0, ForClass <MyComponent> .Property(p => p.Strings));

            pattern.Match(path).Should().Be.True();
            pattern.Apply(path, mapper.Object);
            mapper.Verify(km => km.Table(It.Is <string>(s => s == "MyClassComponentStrings")));
        }
        public void WhenRelationIsOneToManyInsideComponentThenApplyClassNameComponentPropertyNamePropertyName()
        {
            var orm = new Mock<IDomainInspector>();
            var pattern = new CollectionOfElementsTableApplier(orm.Object);

            var mapper = new Mock<ICollectionPropertiesMapper>();
            var level0 = new PropertyPath(null, ForClass<MyClass>.Property(p => p.Component));
            var path = new PropertyPath(level0, ForClass<MyComponent>.Property(p => p.Strings));

            pattern.Match(path).Should().Be.True();
            pattern.Apply(path, mapper.Object);
            mapper.Verify(km => km.Table(It.Is<string>(s => s == "MyClassComponentStrings")));
        }