示例#1
0
 private static void Not_change_the_destination_object(SimpleMapper obj, LowerCaseContext context)
 {
     var result = new MappingTester<OutputClassLowerCase>().Verify(context.Destination, context.Expected);
     result.IsValid.ShouldBeTrue(result.ToString());
 }
示例#2
0
 private static void Map_the_property_values(LowerCaseContext context)
 {
     var result = new MappingTester<OutputClassLowerCase>().Verify(context.Destination, context.Expected);
     result.IsValid.ShouldBeTrue(result.ToString());
 }
示例#3
0
            private static void Inputs_whose_property_names_have_different_casing(SimpleMapper obj, LowerCaseContext context)
            {
                context.Source = new ClassFiller<InputClass>().Source;
                context.Destination = new OutputClassLowerCase();
                context.Expected = new OutputClassLowerCase
                                   {
                                       strIngPropErty = context.Source.StringProperty,
                                   };

                // sanity check that the property names are different by case alone
                var inputPropertyName = Reflection.GetPropertyName((InputClass input) => input.StringProperty);
                var actualPropertyName = Reflection.GetPropertyName((OutputClassLowerCase x) => x.strIngPropErty);
                actualPropertyName.ShouldNotBeEqualTo(inputPropertyName);
                String.Compare(actualPropertyName, inputPropertyName, StringComparison.OrdinalIgnoreCase).ShouldBeEqualTo(0);
            }
示例#4
0
 private static void Map_is_called(SimpleMapper obj, LowerCaseContext context)
 {
     obj.Map(context.Source, context.Destination);
 }
示例#5
0
 private static void A_null_source(SimpleMapper obj, LowerCaseContext context)
 {
     context.Source = null;
     context.Destination = new OutputClassLowerCase();
     context.Expected = new OutputClassLowerCase();
 }