Esempio n. 1
0
        protected override void Establish_context()
        {
            var namingConvention = new StubNamingConvention();

            namingConvention.SplittingExpression = new Regex(@"[\p{Ll}0-9]*(?=_?)");

            _mappingOptions = new StubMappingOptions();
            _mappingOptions.SourceMemberNamingConvention      = new PascalCaseNamingConvention();
            _mappingOptions.DestinationMemberNamingConvention = namingConvention;

            _factory = new TypeMapFactory();
        }
Esempio n. 2
0
        protected override void Establish_context()
        {
            var namingConvention = new StubNamingConvention();

            namingConvention.SeparatorCharacter = "__";

            _mappingOptions = new StubMappingOptions();
            _mappingOptions.SourceMemberNamingConvention      = namingConvention;
            _mappingOptions.DestinationMemberNamingConvention = new PascalCaseNamingConvention();

            _factory = new TypeMapFactory();
        }
        public void Should_map_properties_with_same_name()
        {
            var mappingOptions = new StubMappingOptions();
            mappingOptions.SourceMemberNamingConvention = new PascalCaseNamingConvention();
            mappingOptions.DestinationMemberNamingConvention = new PascalCaseNamingConvention();

            var typeMap = _factory.CreateTypeMap(typeof(Source), typeof(Destination), mappingOptions, MemberList.Destination);

            var propertyMaps = typeMap.GetPropertyMaps();

            propertyMaps.Count().ShouldEqual(2);
        }
        public void Should_map_properties_with_same_name()
        {
            var mappingOptions = new StubMappingOptions();

            mappingOptions.SourceMemberNamingConvention      = new PascalCaseNamingConvention();
            mappingOptions.DestinationMemberNamingConvention = new PascalCaseNamingConvention();

            var typeMap = _factory.CreateTypeMap(typeof(Source), typeof(Destination), mappingOptions, MemberList.Destination);

            var propertyMaps = typeMap.GetPropertyMaps();

            propertyMaps.Count().ShouldEqual(2);
        }
Esempio n. 5
0
        public void Should_map_properties_with_different_names()
        {
            var mappingOptions = new StubMappingOptions();

            mappingOptions.ReplaceMemberName("Ä", "A");
            mappingOptions.ReplaceMemberName("í", "i");
            mappingOptions.ReplaceMemberName("Airlina", "Airline");

            var typeMap = _factory.CreateTypeMap(typeof(Source), typeof(Destination), mappingOptions, MemberList.Destination);

            var propertyMaps = typeMap.GetPropertyMaps();

            propertyMaps.Count().ShouldEqual(3);
        }
Esempio n. 6
0
        public void Should_map_properties_with_different_names()
        {
            var mappingOptions = new StubMappingOptions();
            mappingOptions.ReplaceMemberName("Ä", "A");
            mappingOptions.ReplaceMemberName("í", "i");
            mappingOptions.ReplaceMemberName("Airlina", "Airline");

            var typeMap = _factory.CreateTypeMap(typeof(Source), typeof(Destination), mappingOptions, MemberList.Destination);

            var propertyMaps = typeMap.GetPropertyMaps();

            propertyMaps.Count().ShouldEqual(3);
        }
Esempio n. 7
0
        protected override void Establish_context()
        {
            var namingConvention = new StubNamingConvention();
            namingConvention.SeparatorCharacter = "__";

            _mappingOptions = new StubMappingOptions();
            _mappingOptions.SourceMemberNamingConvention = namingConvention;
            _mappingOptions.DestinationMemberNamingConvention = new PascalCaseNamingConvention();

            _factory = new TypeMapFactory();
        }
Esempio n. 8
0
        protected override void Establish_context()
        {
            var namingConvention = new StubNamingConvention();

            namingConvention.SplittingExpression = new Regex(@"[\p{Ll}0-9]*(?=_?)");

            _mappingOptions = new StubMappingOptions();
            _mappingOptions.SourceMemberNamingConvention = new PascalCaseNamingConvention();
            _mappingOptions.DestinationMemberNamingConvention = namingConvention;

            _factory = new TypeMapFactory();
        }