protected override void Establish_context()
        {
            var namingConvention = new StubNamingConvention();
            namingConvention.SeparatorCharacter = "__";

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

            _factory = new TypeMapFactory();
        }
 protected override void Establish_context()
 {
     _factory = new TypeMapFactory();
 }
        protected override void Establish_context()
        {
            INamingConvention namingConvention = CreateStub<INamingConvention>();
            namingConvention.Stub(nc => nc.SeparatorCharacter).Return("__");

            _mappingOptions = CreateStub<IMappingOptions>();
            _mappingOptions.SourceMemberNamingConvention = namingConvention;
            _mappingOptions.DestinationMemberNamingConvention = new PascalCaseNamingConvention();
            _mappingOptions.SourceMemberNameTransformer = s => s;
            _mappingOptions.DestinationMemberNameTransformer = s => s;

            _factory = new TypeMapFactory();
        }
        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()
        {
            INamingConvention namingConvention = CreateStub<INamingConvention>();

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

            _mappingOptions = CreateStub<IMappingOptions>();
            _mappingOptions.SourceMemberNamingConvention = new PascalCaseNamingConvention();
            _mappingOptions.DestinationMemberNamingConvention = namingConvention;
            _mappingOptions.SourceMemberNameTransformer = s => s;
            _mappingOptions.DestinationMemberNameTransformer = s => s;

            _factory = new TypeMapFactory();
        }
        protected override void Establish_context()
        {
            _mappingOptions = CreateStub<IMappingOptions>();
            Func<string, string> transformer = s =>
                {
                    s = Regex.Replace(s, "(?:^Foo)?(.*)", "$1");
                    return Regex.Replace(s, "(.*)(?:Bar|Blah)$", "$1");
                };
            _mappingOptions.SourceMemberNameTransformer = transformer;
            _mappingOptions.DestinationMemberNameTransformer = s => s;
            _mappingOptions.SourceMemberNamingConvention = new PascalCaseNamingConvention();
            _mappingOptions.DestinationMemberNamingConvention = new PascalCaseNamingConvention();

            _factory = new TypeMapFactory();
        }
        protected override void Establish_context()
        {
            var namingConvention = new StubNamingConvention(s => s.Value.ToLower()){SeparatorCharacter = "__", SplittingExpression = new Regex(@"[\p{Ll}\p{Lu}0-9]+(?=__?)")};

            _mappingOptions = new Profile("Test");
            _mappingOptions.AddMemberConfiguration().AddMember<NameSplitMember>(_ =>
            {
                _.SourceMemberNamingConvention = namingConvention;
                _.DestinationMemberNamingConvention = new PascalCaseNamingConvention();
            });

            _factory = new TypeMapFactory();
        }
Example #8
0
 protected override void Establish_context()
 {
     _factory = new TypeMapFactory();
 }
Example #9
0
 protected override void Because_of()
 {
     _map = TypeMapFactory.CreateTypeMap(typeof(Source), typeof(Destination), _mappingOptions);
 }