How to exclude tests?

Topics: Validation Application Block
Apr 30, 2009 at 11:21 AM

Hi everybody,

I'm using validation blocks to check properties. I have this kind of code :   

[NotNullValidator(MessageTemplate = "City is required.")]
[StringLengthValidator(1, 255, MessageTemplate = "City length is at most 255 characters.")]
public string City { get; set; }

I would like to have different error messages, but I don't want to show them together. If "City" is null, obviously I don't want to continue to test its string length.

Do you know how can I do it?

May 4, 2009 at 2:10 AM
Conditional validation is not directly supported by entlib. 
Refer to this FAQ item -

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.