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); }
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(); }
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); }