public void ClassMappingAutoDiscoversBasicPropertyFromIntToLong() { ClassMappingInstructionHolder mappingInstructions = new ClassMappingInstructionHolder(); mappingInstructions.AddMapping <ExampleClassWithIntProperty, ExampleClassWithLongProperty>(); ICoffeeMapper mapper = new CoffeeMapper(mappingInstructions); ExampleClassWithIntProperty exampleObject1 = GetExampleObjectWithIntProperty(); ExampleClassWithLongProperty result = mapper.Map <ExampleClassWithLongProperty>(exampleObject1); Assert.AreEqual(exampleObject1.A, result.A); }
public void ClassMappingAutoDiscoversBasicPropertyWithMismatchTypes() { ClassMappingInstructionHolder mappingInstructions = new ClassMappingInstructionHolder(); mappingInstructions.AddMapping <ExampleClass1, ExampleClassWithIntProperty>(new ClassMappingInstructionOptions { AutoAddPropertiesWithSameName = true }); ICoffeeMapper mapper = new CoffeeMapper(mappingInstructions); ExampleClass1 exampleObject1 = GetObject1(); ExampleClassWithIntProperty result = mapper.Map <ExampleClassWithIntProperty>(exampleObject1); Assert.AreEqual(exampleObject1.A, result.A); }