This project has moved. For the latest updates, please go here.


Assert.ConfigurationIsValid throws an exception when target is constructed with ConstructUsing


IMO when defining mapping thru ConstructUsing it means we don't want / need to define full mapping for target properties. Hence Assert.ConfigurationIsValid should ignore not-mapped properties on targets resolved with ConstructUsing.

Example with failed expectation:
public class IdentifierBase
    public string Id { get; private set; }
    public IdentifierBase(string id)
        Id = id;

public class MappingTest
    public void ShouldNotRequireFieldsMappingWhenConstructUning()
        Mapper.CreateMap<string, IdentifierBase>().ConstructUsing(o => new IdentifierBase(o));
        Assert.DoesNotThrow(() =>  Mapper.AssertConfigurationIsValid());
Closed Jul 30, 2015 at 1:03 PM by jbogard
The project has moved to github.