3
Vote

Smarter WithMessage

description

Change the way strings are formatted when using WithMessage.
Should be able to supply a lambda with a ValidationError argument (or something more appropriate if it can be found) so that users can do:
engine.For()
    .Setup(m => m.Lastname)
        .MustNotBeNullOrEmpty()
        .WithMessage(m => string.format("{0}, your last name must not be empty.", ((Person)m.OriginatingValue).FirstName));

comments