AutoMapper.UnitTests.Constructors.When_mapping_to_an_object_with_a_constructor_with_multiple_optional_arguments.Should_resolve_constructor_when_args_are_optional C# (CSharp) Méthode

Should_resolve_constructor_when_args_are_optional() private méthode

private Should_resolve_constructor_when_args_are_optional ( ) : void
Résultat void
        public void Should_resolve_constructor_when_args_are_optional()
        {

            var config = new MapperConfiguration(cfg => cfg.CreateMap<SourceFoo, DestinationFoo>());

            var sourceBar = new SourceBar("fooBar");
            var sourceFoo = new SourceFoo(sourceBar);

            var destinationFoo = config.CreateMapper().Map<DestinationFoo>(sourceFoo);

            destinationFoo.Bar.ShouldBeNull();
            destinationFoo.Str.ShouldEqual("hello");
        }
When_mapping_to_an_object_with_a_constructor_with_multiple_optional_arguments