Ejemplo n.º 1
0
        public void Should_have_contextual_mapping_information()
        {
            var source = new Source {
                Value = "adsf"
            };
            AutoMapperMappingException thrown = null;

            try
            {
                Mapper.Map <Source, Dest>(source);
            }
            catch (AutoMapperMappingException ex)
            {
                thrown = ex;
            }
            thrown.ShouldNotBeNull();
        }
Ejemplo n.º 2
0
            public void Should_have_contextual_mapping_information()
            {
                var source = new Source {
                    Value = "adsf"
                };
                AutoMapperMappingException thrown = null;

                try
                {
                    Mapper.Map <Source, Dest>(source);
                }
                catch (AutoMapperMappingException ex)
                {
                    thrown = ex;
                }
                thrown.ShouldNotBeNull();
                thrown.InnerException.ShouldNotBeNull();
                thrown.InnerException.ShouldBeType <AutoMapperMappingException>();
                ((AutoMapperMappingException)thrown.InnerException).Context.PropertyMap.ShouldNotBeNull();
            }