Table of Contents

Class Validate

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Provides a number of different validation methods.

public static class Validate
Inheritance
Validate
Inherited Members

Remarks

You can use the following variables in messages you pass to the Validate methods that are replaced by the following values depending on the result of the validation:

VariableValue if validation succeedsValue if the validation fails
"@ValidateRESULT@""succeeded""failed"
"@ValidateNOT@""""not "
"@ValidateTRUENOT@""not """
For example, the following message will be transformed according to the outcome of the validation:
bool condition = true;
Validate.IsTrue(condition, "The validation @ValidateRESULT@.");

Fields

DefaultMessage

Use the value of this property to specify that the default validation message should be used.

public static readonly string DefaultMessage

Field Value

string

Properties

EnableReport

Gets or sets a value indicating whether validations should produce report messages or not.

public static bool EnableReport { get; set; }

Property Value

bool

Methods

AreEqual(object, object)

Validates if the actual value of an object equals an expected value.

public static void AreEqual(object actual, object expected)

Parameters

actual object

The actual value of the object.

expected object

The expected value of the object.

Exceptions

ValidationException

If the validation fails.

AreEqual(object, object, string)

Validates if the actual value of an object equals an expected value.

public static void AreEqual(object actual, object expected, string message)

Parameters

actual object

The actual value of the object.

expected object

The expected value of the object.

message string

The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of expected.

Exceptions

ValidationException

If the validation fails.

AreEqual(object, object, string, Options)

Validates if the actual value of an object equals an expected value.

public static bool AreEqual(object actual, object expected, string message, Validate.Options options)

Parameters

actual object

The actual value of the object.

expected object

The expected value of the object.

message string

The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of expected.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if actual and expected are equal; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AreEqual(object, object, string, bool)

Validates if the actual value of an object equals an expected value.

public static bool AreEqual(object actual, object expected, string message, bool exceptionOnFail)

Parameters

actual object

The actual value of the object.

expected object

The expected value of the object.

message string

The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of expected.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if actual and expected are equal; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

AreEqual(string, Regex)

Validates if the given regular expression matches the given string.

public static void AreEqual(string actual, Regex regex)

Parameters

actual string

The string to match.

regex Regex

The regular expression.

Exceptions

ValidationException

If the validation fails.

AreEqual(string, Regex, string)

Validates if the given regular expression matches the given string.

public static void AreEqual(string actual, Regex regex, string message)

Parameters

actual string

The string to match.

regex Regex

The regular expression to match.

message string

The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of regex.

Exceptions

ValidationException

If the validation fails.

AreEqual(string, Regex, string, Options)

Validates if the given regular expression matches the given string.

public static bool AreEqual(string actual, Regex regex, string message, Validate.Options options)

Parameters

actual string

The string to match.

regex Regex

The regular expression to match.

message string

The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of regex.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if regex matches actual; otherwise false.

Exceptions

ArgumentNullException

If regex is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AreEqual(string, Regex, string, bool)

Validates if the given regular expression matches the given string.

public static bool AreEqual(string actual, Regex regex, string message, bool exceptionOnFail)

Parameters

actual string

The string to match.

regex Regex

The regular expression to match.

message string

The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of regex.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if regex matches actual; otherwise false.

Exceptions

ArgumentNullException

If regex is null.

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeContains(IElement, string, string)

Validates if the attribute of the specified element contains a specific value.

public static void AttributeContains(IElement element, string name, string value)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeContains(IElement, string, string, string)

Validates if the attribute of the specified element contains a specific value.

public static void AttributeContains(IElement element, string name, string value, string message)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeContains(IElement, string, string, string, Options)

Validates if the attribute of the specified element contains a specific value.

public static bool AttributeContains(IElement element, string name, string value, string message, Validate.Options options)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeContains(IElement, string, string, string, bool)

Validates if the attribute of the specified element contains a specific value.

public static bool AttributeContains(IElement element, string name, string value, string message, bool exceptionOnFail)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeContains(RepoItemInfo, string, string)

Validates if the attribute of the element for the specified repository item contains a specific value.

public static void AttributeContains(RepoItemInfo itemInfo, string name, string value)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeContains(RepoItemInfo, string, string, string)

Validates if the attribute of the element for the specified repository item contains a specific value.

public static void AttributeContains(RepoItemInfo itemInfo, string name, string value, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeContains(RepoItemInfo, string, string, string, Options)

Validates if the attribute of the element for the specified repository item contains a specific value.

public static bool AttributeContains(RepoItemInfo itemInfo, string name, string value, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeContains(RepoItemInfo, string, string, string, bool)

Validates if the attribute of the element for the specified repository item contains a specific value.

public static bool AttributeContains(RepoItemInfo itemInfo, string name, string value, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeEqual(IElement, string, object)

Validates if the attribute of the specified element matches a specific value.

public static void AttributeEqual(IElement element, string name, object value)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

Exceptions

ValidationException

If the validation fails.

AttributeEqual(IElement, string, object, string)

Validates if the attribute of the specified element matches a specific value.

public static void AttributeEqual(IElement element, string name, object value, string message)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ValidationException

If the validation fails.

AttributeEqual(IElement, string, object, string, Options)

Validates if the attribute of the specified element matches a specific value.

public static bool AttributeEqual(IElement element, string name, object value, string message, Validate.Options options)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value matches the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeEqual(IElement, string, object, string, bool)

Validates if the attribute of the specified element matches a specific value.

public static bool AttributeEqual(IElement element, string name, object value, string message, bool exceptionOnFail)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value matches the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeEqual(RepoItemInfo, string, object)

Validates if the attribute of the element for the specified repository item matches a specific value.

public static void AttributeEqual(RepoItemInfo itemInfo, string name, object value)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

Exceptions

ValidationException

If the validation fails.

AttributeEqual(RepoItemInfo, string, object, string)

Validates if the attribute of the element for the specified repository item matches a specific value.

public static void AttributeEqual(RepoItemInfo itemInfo, string name, object value, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ValidationException

If the validation fails.

AttributeEqual(RepoItemInfo, string, object, string, Options)

Validates if the attribute of the element for the specified repository item matches a specific value.

public static bool AttributeEqual(RepoItemInfo itemInfo, string name, object value, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value matches the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeEqual(RepoItemInfo, string, object, string, bool)

Validates if the attribute of the element for the specified repository item matches a specific value.

public static bool AttributeEqual(RepoItemInfo itemInfo, string name, object value, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute to match.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value matches the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeNotContains(IElement, string, string)

Validates if the attribute of the specified element does not contain the specific value.

public static void AttributeNotContains(IElement element, string name, string value)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeNotContains(IElement, string, string, string)

Validates if the attribute of the specified element does not contain the specific value.

public static void AttributeNotContains(IElement element, string name, string value, string message)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeNotContains(IElement, string, string, string, Options)

Validates if the attribute of the specified element does not contain the specific value.

public static bool AttributeNotContains(IElement element, string name, string value, string message, Validate.Options options)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeNotContains(IElement, string, string, string, bool)

Validates if the attribute of the specified element does not contain the specific value.

public static bool AttributeNotContains(IElement element, string name, string value, string message, bool exceptionOnFail)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeNotContains(RepoItemInfo, string, string)

Validates if the attribute of the element for the specified repository item does not contain the specific value.

public static void AttributeNotContains(RepoItemInfo itemInfo, string name, string value)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeNotContains(RepoItemInfo, string, string, string)

Validates if the attribute of the element for the specified repository item does not contain the specific value.

public static void AttributeNotContains(RepoItemInfo itemInfo, string name, string value, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails.

AttributeNotContains(RepoItemInfo, string, string, string, Options)

Validates if the attribute of the element for the specified repository item does not contain the specific value.

public static bool AttributeNotContains(RepoItemInfo itemInfo, string name, string value, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeNotContains(RepoItemInfo, string, string, string, bool)

Validates if the attribute of the element for the specified repository item does not contain the specific value.

public static bool AttributeNotContains(RepoItemInfo itemInfo, string name, string value, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value string

The value of the attribute to contain.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value contains the specified value; otherwise false.

Exceptions

ArgumentNullException

If value is null.

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeNotEqual(IElement, string, object)

Validates if the attribute of the specified element does not match a specific value.

public static void AttributeNotEqual(IElement element, string name, object value)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

Exceptions

ValidationException

If the validation fails.

AttributeNotEqual(IElement, string, object, string)

Validates if the attribute of the specified element does not match a specific value.

public static void AttributeNotEqual(IElement element, string name, object value, string message)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ValidationException

If the validation fails.

AttributeNotEqual(IElement, string, object, string, Options)

Validates if the attribute of the specified element does not match a specific value.

public static bool AttributeNotEqual(IElement element, string name, object value, string message, Validate.Options options)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value does not match the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeNotEqual(IElement, string, object, string, bool)

Validates if the attribute of the specified element does not match a specific value.

public static bool AttributeNotEqual(IElement element, string name, object value, string message, bool exceptionOnFail)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value does not match the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeNotEqual(RepoItemInfo, string, object)

Validates if the attribute of the element for the specified repository item does not match a specific value.

public static void AttributeNotEqual(RepoItemInfo itemInfo, string name, object value)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

Exceptions

ValidationException

If the validation fails.

AttributeNotEqual(RepoItemInfo, string, object, string)

Validates if the attribute of the element for the specified repository item does not match a specific value.

public static void AttributeNotEqual(RepoItemInfo itemInfo, string name, object value, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

Exceptions

ValidationException

If the validation fails.

AttributeNotEqual(RepoItemInfo, string, object, string, Options)

Validates if the attribute of the element for the specified repository item does not match a specific value.

public static bool AttributeNotEqual(RepoItemInfo itemInfo, string name, object value, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the attribute value does not match the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeNotEqual(RepoItemInfo, string, object, string, bool)

Validates if the attribute of the element for the specified repository item does not match a specific value.

public static bool AttributeNotEqual(RepoItemInfo itemInfo, string name, object value, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

value object

The value of the attribute not to match.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of the expected value.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the attribute value does not match the specified value; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeRegex(IElement, string, Regex)

Validates if the attribute of the specified element matches a specific regular expression.

public static void AttributeRegex(IElement element, string name, Regex regex)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

Exceptions

ValidationException

If the validation fails.

AttributeRegex(IElement, string, Regex, string)

Validates if the attribute of the specified element matches a specific regular expression.

public static void AttributeRegex(IElement element, string name, Regex regex, string message)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of regex.

Exceptions

ValidationException

If the validation fails.

AttributeRegex(IElement, string, Regex, string, Options)

Validates if the attribute of the specified element matches a specific regular expression.

public static bool AttributeRegex(IElement element, string name, Regex regex, string message, Validate.Options options)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of regex.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the specified regex matches the attribute value; otherwise false.

Exceptions

ArgumentNullException

If regex is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeRegex(IElement, string, Regex, string, bool)

Validates if the attribute of the specified element matches a specific regular expression.

public static bool AttributeRegex(IElement element, string name, Regex regex, string message, bool exceptionOnFail)

Parameters

element IElement

The element to validate.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

message string

The message to log. "{0}" is replaced by the string representation of the element, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of regex.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the specified regex matches the attribute value; otherwise false.

Exceptions

ArgumentNullException

If regex is null.

ValidationException

If the validation fails and exceptionOnFail is true.

AttributeRegex(RepoItemInfo, string, Regex)

Validates if the attribute of the element for the specified repository item matches a specific regular expression.

public static void AttributeRegex(RepoItemInfo itemInfo, string name, Regex regex)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

Exceptions

ValidationException

If the validation fails.

AttributeRegex(RepoItemInfo, string, Regex, string)

Validates if the attribute of the element for the specified repository item matches a specific regular expression.

public static void AttributeRegex(RepoItemInfo itemInfo, string name, Regex regex, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of regex.

Exceptions

ValidationException

If the validation fails.

AttributeRegex(RepoItemInfo, string, Regex, string, Options)

Validates if the attribute of the element for the specified repository item matches a specific regular expression.

public static bool AttributeRegex(RepoItemInfo itemInfo, string name, Regex regex, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of regex.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the specified regex matches the attribute value; otherwise false.

Exceptions

ArgumentNullException
ValidationException

If the validation fails and options.ExceptionOnFail is true.

AttributeRegex(RepoItemInfo, string, Regex, string, bool)

Validates if the attribute of the element for the specified repository item matches a specific regular expression.

public static bool AttributeRegex(RepoItemInfo itemInfo, string name, Regex regex, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

name string

The name of the attribute to validate.

regex Regex

The regular expression to validate the attribute value string representation against.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object, "{1}" by the attribute name, "{2}" by the string representation of the actual attribute value (or "(not retrieved)" if the attribute could not be retrieved), and "{3}" by the string representation of regex.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the specified regex matches the attribute value; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

CompareImage(Element, Bitmap, FindOptions)

Validates if the screenshot of the specified element matches the given image.

public static void CompareImage(Element element, Bitmap image, Imaging.FindOptions findOptions)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image which is compared to the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

CompareImage(Element, Bitmap, FindOptions, string)

Validates if the screenshot of the specified element matches the given image.

public static void CompareImage(Element element, Bitmap image, Imaging.FindOptions findOptions, string message)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image which is compared to the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

message string

The message to log. "{0}" is replaced by the string representation of the element.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

CompareImage(Element, Bitmap, FindOptions, string, Options)

Validates if the screenshot of the specified element matches the given image.

public static bool CompareImage(Element element, Bitmap image, Imaging.FindOptions findOptions, string message, Validate.Options options)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image which is compared to the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

message string

The message to log. "{0}" is replaced by the string representation of the element.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the specified image matches the screenshot of the element; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

CompareImage(Element, Bitmap, FindOptions, string, bool)

Validates if the screenshot of the specified element matches the given image.

public static bool CompareImage(Element element, Bitmap image, Imaging.FindOptions findOptions, string message, bool exceptionOnFail)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image which is compared to the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

message string

The message to log. "{0}" is replaced by the string representation of the element.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the specified image matches the screenshot of the element; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and exceptionOnFail is true.

CompareImage(RepoItemInfo, Bitmap, FindOptions)

Validates if the screenshot of the specified repository item matches the given image.

public static void CompareImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image which is compared to the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

CompareImage(RepoItemInfo, Bitmap, FindOptions, string)

Validates if the screenshot of the specified repository item matches the given image.

public static void CompareImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image which is compared to the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

CompareImage(RepoItemInfo, Bitmap, FindOptions, string, Options)

Validates if the screenshot of the specified repository item matches the given image.

public static bool CompareImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image which is compared to the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the specified image matches the screenshot of the itemInfo; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

CompareImage(RepoItemInfo, Bitmap, FindOptions, string, bool)

Validates if the screenshot of the specified repository item matches the given image.

public static bool CompareImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image which is compared to the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the comparison.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the specified image matches the screenshot of the itemInfo; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and exceptionOnFail is true.

ContainsImage(Element, Bitmap, FindOptions)

Validates if the screenshot of the specified element contains the given image.

public static void ContainsImage(Element element, Bitmap image, Imaging.FindOptions findOptions)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image to search inside the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

ContainsImage(Element, Bitmap, FindOptions, string)

Validates if the screenshot of the specified element contains the given image.

public static void ContainsImage(Element element, Bitmap image, Imaging.FindOptions findOptions, string message)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image to search inside the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

message string

The message to log. "{0}" is replaced by the string representation of the element.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

ContainsImage(Element, Bitmap, FindOptions, string, Options)

Validates if the screenshot of the specified element contains the given image.

public static bool ContainsImage(Element element, Bitmap image, Imaging.FindOptions findOptions, string message, Validate.Options options)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image to search inside the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

message string

The message to log. "{0}" is replaced by the string representation of the element.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the specified image is contained in the screenshot of the element; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

ContainsImage(Element, Bitmap, FindOptions, string, bool)

Validates if the screenshot of the specified element contains the given image.

public static bool ContainsImage(Element element, Bitmap image, Imaging.FindOptions findOptions, string message, bool exceptionOnFail)

Parameters

element Element

The element to take the screenshot from.

image Bitmap

The image to search inside the element screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

message string

The message to log. "{0}" is replaced by the string representation of the element.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the specified image is contained in the screenshot of the element; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and exceptionOnFail is true.

ContainsImage(RepoItemInfo, Bitmap, FindOptions)

Validates if the screenshot of the specified repository item contains the given image.

public static void ContainsImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image to search inside the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

ContainsImage(RepoItemInfo, Bitmap, FindOptions, string)

Validates if the screenshot of the specified repository item contains the given image.

public static void ContainsImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image to search inside the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails.

ContainsImage(RepoItemInfo, Bitmap, FindOptions, string, Options)

Validates if the screenshot of the specified repository item contains the given image.

public static bool ContainsImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image to search inside the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the specified image is contained in the screenshot of the itemInfo; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and options.ExceptionOnFail is true.

ContainsImage(RepoItemInfo, Bitmap, FindOptions, string, bool)

Validates if the screenshot of the specified repository item contains the given image.

public static bool ContainsImage(RepoItemInfo itemInfo, Bitmap image, Imaging.FindOptions findOptions, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

image Bitmap

The image to search inside the item screenshot.

findOptions Imaging.FindOptions

A Imaging.FindOptions instance that defines the options for the search.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the specified image is contained in the screenshot of the itemInfo; otherwise false.

Exceptions

ArgumentNullException

If image is null.

ValidationException

If the validation fails and exceptionOnFail is true.

Exists(Element)

Validates if the specified element exists.

public static void Exists(Element element)

Parameters

element Element

The element to validate.

Exceptions

ValidationException

If the validation fails.

Exists(Element, string)

Validates if the specified element exists.

public static void Exists(Element element, string message)

Parameters

element Element

The element to validate.

message string

The message to log. "{0}" is replaced by the string representation of the element.

Exceptions

ValidationException

If the validation fails.

Exists(Element, string, Options)

Validates if the specified element exists.

public static bool Exists(Element element, string message, Validate.Options options)

Parameters

element Element

The element to validate.

message string

The message to log. "{0}" is replaced by the string representation of the element.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the element exists; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

Exists(Element, string, bool)

Validates if the specified element exists.

public static bool Exists(Element element, string message, bool exceptionOnFail)

Parameters

element Element

The element to validate.

message string

The message to log. "{0}" is replaced by the string representation of the element.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the element exists; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

Exists(RepoItemInfo)

Validates if the element for the specified repository item exists.

public static void Exists(RepoItemInfo itemInfo)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

Exceptions

ValidationException

If the validation fails.

Exists(RepoItemInfo, string)

Validates if the element for the specified repository item exists.

public static void Exists(RepoItemInfo itemInfo, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

Exceptions

ValidationException

If the validation fails.

Exists(RepoItemInfo, string, Options)

Validates if the element for the specified repository item exists.

public static bool Exists(RepoItemInfo itemInfo, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the element for the repository item exists; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

Exists(RepoItemInfo, string, bool)

Validates if the element for the specified repository item exists.

public static bool Exists(RepoItemInfo itemInfo, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the element for the repository item exists; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

Exists(RxPath)

Validates if the element for the specified path exists using the DefaultSearchTimeout to keep looking for an element matching the path.

public static void Exists(RxPath path)

Parameters

path RxPath

The path to validate.

Exceptions

ValidationException

If the validation fails.

Exists(RxPath, Duration)

Validates if the element for the specified path exists.

public static void Exists(RxPath path, Duration searchTimeout)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

Exceptions

ValidationException

If the validation fails.

Exists(RxPath, Duration, string)

Validates if the element for the specified path exists.

public static void Exists(RxPath path, Duration searchTimeout, string message)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the string representation of the path.

Exceptions

ValidationException

If the validation fails.

Exists(RxPath, Duration, string, Options)

Validates if the element for the specified path exists.

public static bool Exists(RxPath path, Duration searchTimeout, string message, Validate.Options options)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the string representation of the path.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the element for the path exists; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

Exists(RxPath, Duration, string, bool)

Validates if the element for the specified path exists.

public static bool Exists(RxPath path, Duration searchTimeout, string message, bool exceptionOnFail)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the string representation of the path.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the element for the path exists; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

Exists(string)

Validates if the element for the specified path exists using the DefaultSearchTimeout to keep looking for an element matching the path.

public static void Exists(string path)

Parameters

path string

The path to validate.

Exceptions

ValidationException

If the validation fails.

Exists(string, Duration)

Validates if the element for the specified path exists.

public static void Exists(string path, Duration searchTimeout)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

Exceptions

ValidationException

If the validation fails.

Exists(string, Duration, string)

Validates if the element for the specified path exists.

public static void Exists(string path, Duration searchTimeout, string message)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the path.

Exceptions

ValidationException

If the validation fails.

Exists(string, Duration, string, Options)

Validates if the element for the specified path exists.

public static bool Exists(string path, Duration searchTimeout, string message, Validate.Options options)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the path.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the path is valid and the element for the path exists; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

Exists(string, Duration, string, bool)

Validates if the element for the specified path exists.

public static bool Exists(string path, Duration searchTimeout, string message, bool exceptionOnFail)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the path.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the path is valid and the element for the path exists; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

Fail()

Always lets the validation fail.

public static void Fail()

Remarks

Use this method to mark a 'test case' or 'smart folder' as failed and immediately exit the current module and test iteration.

Exceptions

ValidationException

Always thrown.

Fail(string)

Always lets the validation fail.

public static void Fail(string message)

Parameters

message string

The message to log.

Remarks

Use this method to mark a 'test case' or 'smart folder' as failed and immediately exit the current module and test iteration.

Exceptions

ValidationException

Always thrown.

Fail(string, Options)

Always lets the validation fail.

public static bool Fail(string message, Validate.Options options)

Parameters

message string

The message to log.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

Always returns false (unless a ValidationException is thrown depending on the passed options).

Exceptions

ValidationException

If options.ExceptionOnFail is true.

IsFalse(bool)

Validates if the given condition is false.

public static void IsFalse(bool condition)

Parameters

condition bool

The condition to validate.

Exceptions

ValidationException

If the validation fails.

IsFalse(bool, string)

Validates if the given condition is false.

public static void IsFalse(bool condition, string message)

Parameters

condition bool

The condition to validate.

message string

The message to log.

Exceptions

ValidationException

If the validation fails.

IsFalse(bool, string, Options)

Validates if the given condition is false.

public static bool IsFalse(bool condition, string message, Validate.Options options)

Parameters

condition bool

The condition to validate.

message string

The message to log.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

true if the specified condition is false; otherwise, false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

IsFalse(bool, string, bool)

Validates if the given condition is false.

public static bool IsFalse(bool condition, string message, bool exceptionOnFail)

Parameters

condition bool

The condition to validate.

message string

The message to log.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

true if the specified condition is false; otherwise, false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

IsTrue(bool)

Validates if the given condition is true.

public static void IsTrue(bool condition)

Parameters

condition bool

The condition to validate.

Exceptions

ValidationException

If the validation fails.

IsTrue(bool, string)

Validates if the given condition is true.

public static void IsTrue(bool condition, string message)

Parameters

condition bool

The condition to validate.

message string

The message to log.

Exceptions

ValidationException

If the validation fails.

IsTrue(bool, string, Options)

Validates if the given condition is true.

public static bool IsTrue(bool condition, string message, Validate.Options options)

Parameters

condition bool

The condition to validate.

message string

The message to log.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

true if the specified condition is true; otherwise, false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

IsTrue(bool, string, bool)

Validates if the given condition is true.

public static bool IsTrue(bool condition, string message, bool exceptionOnFail)

Parameters

condition bool

The condition to validate.

message string

The message to log.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

true if the specified condition is true; otherwise, false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

NotExists(Element)

Validates if the specified element does not exist.

public static void NotExists(Element element)

Parameters

element Element

The element to validate.

Exceptions

ValidationException

If the validation fails.

NotExists(Element, string)

Validates if the specified element does not exist.

public static void NotExists(Element element, string message)

Parameters

element Element

The element to validate.

message string

The message to log. "{0}" is replaced by the string representation of the element.

Exceptions

ValidationException

If the validation fails.

NotExists(Element, string, Options)

Validates if the specified element does not exist.

public static bool NotExists(Element element, string message, Validate.Options options)

Parameters

element Element

The element to validate.

message string

The message to log. "{0}" is replaced by the string representation of the element.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the element does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

NotExists(Element, string, bool)

Validates if the specified element does not exist.

public static bool NotExists(Element element, string message, bool exceptionOnFail)

Parameters

element Element

The element to validate.

message string

The message to log. "{0}" is replaced by the string representation of the element.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the element does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

NotExists(RepoItemInfo)

Validates if the element for the specified repository item does not exist.

public static void NotExists(RepoItemInfo itemInfo)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

Exceptions

ValidationException

If the validation fails.

NotExists(RepoItemInfo, string)

Validates if the element for the specified repository item does not exist.

public static void NotExists(RepoItemInfo itemInfo, string message)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

Exceptions

ValidationException

If the validation fails.

NotExists(RepoItemInfo, string, Options)

Validates if the element for the specified repository item does not exist.

public static bool NotExists(RepoItemInfo itemInfo, string message, Validate.Options options)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the element for the repository item does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

NotExists(RepoItemInfo, string, bool)

Validates if the element for the specified repository item does not exist.

public static bool NotExists(RepoItemInfo itemInfo, string message, bool exceptionOnFail)

Parameters

itemInfo RepoItemInfo

The RepoItemInfo object for the repository item.

message string

The message to log. "{0}" is replaced by the name of the itemInfo object.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the element for the repository item does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

NotExists(RxPath)

Validates if the element for the specified path does not exist using the DefaultSearchTimeout to keep looking for an element matching the path.

public static void NotExists(RxPath path)

Parameters

path RxPath

The path to validate.

Exceptions

ValidationException

If the validation fails.

NotExists(RxPath, Duration)

Validates if the element for the specified path does not exist.

public static void NotExists(RxPath path, Duration searchTimeout)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

Exceptions

ValidationException

If the validation fails.

NotExists(RxPath, Duration, string)

Validates if the element for the specified path does not exist.

public static void NotExists(RxPath path, Duration searchTimeout, string message)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the string representation of the path.

Exceptions

ValidationException

If the validation fails.

NotExists(RxPath, Duration, string, Options)

Validates if the element for the specified path does not exist.

public static bool NotExists(RxPath path, Duration searchTimeout, string message, Validate.Options options)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the string representation of the path.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the element for the path does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

NotExists(RxPath, Duration, string, bool)

Validates if the element for the specified path does not exist.

public static bool NotExists(RxPath path, Duration searchTimeout, string message, bool exceptionOnFail)

Parameters

path RxPath

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the string representation of the path.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the element for the path does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.

NotExists(string)

Validates if the element for the specified path does not exist using the DefaultSearchTimeout to keep looking for an element matching the path.

public static void NotExists(string path)

Parameters

path string

The path to validate.

Exceptions

ValidationException

If the validation fails.

NotExists(string, Duration)

Validates if the element for the specified path does not exist.

public static void NotExists(string path, Duration searchTimeout)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

Exceptions

ValidationException

If the validation fails.

NotExists(string, Duration, string)

Validates if the element for the specified path does not exist.

public static void NotExists(string path, Duration searchTimeout, string message)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the path.

Exceptions

ValidationException

If the validation fails.

NotExists(string, Duration, string, Options)

Validates if the element for the specified path does not exist.

public static bool NotExists(string path, Duration searchTimeout, string message, Validate.Options options)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the path.

options Validate.Options

Additional Validate.Options for this validation action.

Returns

bool

True if the path is not valid or the element for the path does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and options.ExceptionOnFail is true.

NotExists(string, Duration, string, bool)

Validates if the element for the specified path does not exist.

public static bool NotExists(string path, Duration searchTimeout, string message, bool exceptionOnFail)

Parameters

path string

The path to validate.

searchTimeout Duration

The time to keep looking for an element matching the path.

message string

The message to log. "{0}" is replaced by the path.

exceptionOnFail bool

A value specifying if an exception should be thrown if the validation fails.

Returns

bool

True if the path is not valid or the element for the path does not exist; otherwise false.

Exceptions

ValidationException

If the validation fails and exceptionOnFail is true.