Exemplo n.º 1
0
        public static void AssertConfigurationIsValid(this IMapToDefine mapToDefine)
        {
            var configuration = ConfigurationHelpers.CreateDefaultConfiguration();

            mapToDefine.DefineMap(configuration);
            configuration.AssertConfigurationIsValid();
        }
Exemplo n.º 2
0
        public void Map_PassedTAndMappingConfigurationInConstructor_ReturnsMappedObject()
        {
            // arrange

            var mappingConfiguration = ConfigurationHelpers.CreateDefaultConfiguration();

            mappingConfiguration.CreateMap <Apple, Orange>();

            var converter = new TestObjectMapper(mappingConfiguration);

            // act
            var orange = converter.CreateInstance(new Apple {
                Type = "TEST"
            });

            // assert
            Assert.AreEqual("TEST", orange.Type);
        }