Trying to validate without recording a failure...
Posted: Wed Sep 26, 2012 8:46 am
Hi,
I am using the following method from the Validate class, to carry out some validation.
public static bool Attribute(
RepoItemInfo itemInfo,
string name,
Object value,
string message,
bool exceptionOnFail
)
I am passing exceptionOnFail = false, to ensure no exception is thrown if the validation fails. However if validation does fail, a Failure is still recorded in the report, so the module itself fails: "The module has failed because one or more actions have failed."
Is there a way to ensure the module still records a success, despite the failure on this validation?
Essentially I am trying to validate an element against several options - if it doesn't match the first option then validate against the second option; failure should only occur if it doesn't match either option. Is there a better way to do this?
I am using the following method from the Validate class, to carry out some validation.
public static bool Attribute(
RepoItemInfo itemInfo,
string name,
Object value,
string message,
bool exceptionOnFail
)
I am passing exceptionOnFail = false, to ensure no exception is thrown if the validation fails. However if validation does fail, a Failure is still recorded in the report, so the module itself fails: "The module has failed because one or more actions have failed."
Is there a way to ensure the module still records a success, despite the failure on this validation?
Essentially I am trying to validate an element against several options - if it doesn't match the first option then validate against the second option; failure should only occur if it doesn't match either option. Is there a better way to do this?