Table of Contents

Class Validate.Options

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Provides additional options for a validation action.

public sealed class Validate.Options : IEquatable<Validate.Options>
Inheritance
Validate.Options
Implements
Inherited Members

Constructors

Options()

Initializes a new instance of the Validate.Options class with default values.

public Options()

Options(ReportLevel)

Initializes a new instance of the Validate.Options class.

public Options(ReportLevel reportLevelOnFailure)

Parameters

reportLevelOnFailure ReportLevel

The report level used if the validation fails.

Options(ReportLevel, ResultOption)

Initializes a new instance of the Validate.Options class.

public Options(ReportLevel reportLevelOnFailure, Validate.ResultOption reportScreenshot)

Parameters

reportLevelOnFailure ReportLevel

The report level used if the validation fails.

reportScreenshot Validate.ResultOption

A value specifying whether to add a screenshot to the report.

Options(ResultOption)

Initializes a new instance of the Validate.Options class.

public Options(Validate.ResultOption reportScreenshot)

Parameters

reportScreenshot Validate.ResultOption

A value specifying whether to add a screenshot to the report.

Options(bool)

Initializes a new instance of the Validate.Options class.

public Options(bool exceptionOnFail)

Parameters

exceptionOnFail bool

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

Options(bool, ReportLevel)

Initializes a new instance of the Validate.Options class.

public Options(bool exceptionOnFail, ReportLevel reportLevelOnFailure)

Parameters

exceptionOnFail bool

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

reportLevelOnFailure ReportLevel

The report level used if the validation fails.

Options(bool, ReportLevel, ReportLevel, ResultOption)

Initializes a new instance of the Validate.Options class.

public Options(bool exceptionOnFail, ReportLevel reportLevelOnFailure, ReportLevel reportLevelOnSuccess, Validate.ResultOption reportScreenshot)

Parameters

exceptionOnFail bool

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

reportLevelOnFailure ReportLevel

The report level used if the validation fails.

reportLevelOnSuccess ReportLevel

The report level used if the validation succeeds.

reportScreenshot Validate.ResultOption

A value specifying whether to add a screenshot to the report.

Options(bool, ReportLevel, ReportLevel, ResultOption, ResultOption, ResultOption, ResultOption, Duration)

Initializes a new instance of the Validate.Options class.

public Options(bool exceptionOnFail, ReportLevel reportLevelOnFailure, ReportLevel reportLevelOnSuccess, Validate.ResultOption reportScreenshot, Validate.ResultOption reportSimilarity, Validate.ResultOption reportDifferenceImages, Validate.ResultOption reportExpectedAndActualImages, Duration gracePeriod)

Parameters

exceptionOnFail bool

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

reportLevelOnFailure ReportLevel

The report level used if the validation fails.

reportLevelOnSuccess ReportLevel

The report level used if the validation succeeds.

reportScreenshot Validate.ResultOption

A value specifying whether to add a screenshot to the report.

reportSimilarity Validate.ResultOption

A value specifying whether to add similarity results to the report.

reportDifferenceImages Validate.ResultOption

A value specifying whether to add difference images to the report.

reportExpectedAndActualImages Validate.ResultOption

A value specifying whether to add the expected and actual images to the report.

gracePeriod Duration

The grace period allowed for values to stabilize

Options(bool, ReportLevel, ResultOption)

Initializes a new instance of the Validate.Options class.

public Options(bool exceptionOnFail, ReportLevel reportLevelOnFailure, Validate.ResultOption reportScreenshot)

Parameters

exceptionOnFail bool

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

reportLevelOnFailure ReportLevel

The report level used if the validation fails.

reportScreenshot Validate.ResultOption

A value specifying whether to add a screenshot to the report.

Options(bool, ResultOption)

Initializes a new instance of the Validate.Options class.

public Options(bool exceptionOnFail, Validate.ResultOption reportScreenshot)

Parameters

exceptionOnFail bool

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

reportScreenshot Validate.ResultOption

A value specifying whether to add a screenshot to the report.

Properties

Default

Gets or set the default options for validation actions.

public static Validate.Options Default { get; set; }

Property Value

Validate.Options

Remarks

If you do not want to modify the default options please use the empty constructor instead of this property.

Exceptions

ArgumentNullException

If setting this property to null.

ExceptionOnFail

Gets or sets a value indicating whether an exception should be thrown if the validation fails.

public bool ExceptionOnFail { get; set; }

Property Value

bool

true if an exception should be thrown if the validation fails; otherwise, false.

GracePeriod

Gets or sets the grace period allowed for attribute validations to stabilize before the validation fails.

public Duration GracePeriod { get; set; }

Property Value

Duration

The grace period.

ReportDifferenceImages

Gets or sets a value specifying whether to add difference images to the report for image comparisons.

public Validate.ResultOption ReportDifferenceImages { get; set; }

Property Value

Validate.ResultOption

A value specifying whether to add difference images to the report.

ReportExpectedAndActualImages

Gets or sets a value specifying whether to add the expected and actual images to the report for image validations.

public Validate.ResultOption ReportExpectedAndActualImages { get; set; }

Property Value

Validate.ResultOption

A value specifying whether to add the expected and actual images to the report.

ReportLevelOnFailure

Gets or sets the report level used if the validation fails.

public ReportLevel ReportLevelOnFailure { get; set; }

Property Value

ReportLevel

The report level on failure.

ReportLevelOnSuccess

Gets or sets the report level used if the validation succeeds.

public ReportLevel ReportLevelOnSuccess { get; set; }

Property Value

ReportLevel

The report level on success.

ReportScreenshot

Gets or sets a value specifying whether to add a screenshot to the report.

public Validate.ResultOption ReportScreenshot { get; set; }

Property Value

Validate.ResultOption

A value specifying whether to add a screenshot to the report.

ReportSimilarity

Gets or sets a value specifying whether to add the effective image similarity to the report.

public Validate.ResultOption ReportSimilarity { get; set; }

Property Value

Validate.ResultOption

A value specifying whether to add the effective image similarity to the report.

Methods

Equals(Options)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Validate.Options other)

Parameters

other Validate.Options

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Exceptions

NotImplementedException

Equals(Options, Options)

Returns true if the two instances are equal.

public static bool Equals(Validate.Options a, Validate.Options b)

Parameters

a Validate.Options

An instance.

b Validate.Options

Another instance.

Returns

bool

True if the two instances are equal, otherwise false.

Equals(object)

Determines whether this instance is equal to obj.

public override bool Equals(object obj)

Parameters

obj object

Another instance.

Returns

bool

True if this instance is equal to obj, otherwise false.

GetHashCode()

Returns a static, very poor performing hash code!

public override int GetHashCode()

Returns

int

A hash code for this instance.

Remarks

Since Validate.Options instances are not immutable, the only way to satisfy all Equals(object) and GetHashCode() requirements is to return a static number for all Validate.Options instances. Consequently, the performance of a hash table storing Validate.Options instances will be very poor (hash table degenerates to list)!

Parse(string)

Parses the given string and returns a new Validate.Options instance.

public static Validate.Options Parse(string optionsString)

Parameters

optionsString string

A string representing the find options.

Returns

Validate.Options

A new Validate.Options corresponding to the given string.

Exceptions

ArgumentNullException

If optionsString is null.

FormatException

If optionsString has an invalid format.

ToString()

Returns a string representation of the instance.

public override string ToString()

Returns

string

A string representation of the instance.

TryParse(string, out Options)

Tries parsing the given string to a Validate.Options instance.

public static bool TryParse(string optionsString, out Validate.Options options)

Parameters

optionsString string

A string representing the validate options.

options Validate.Options

When this method returns, contains a Validate.Options instance if parsing succeeded, null otherwise.

Returns

bool

True if parsing succeeded, otherwise false.

Operators

operator ==(Options, Options)

Implements the operator ==.

public static bool operator ==(Validate.Options a, Validate.Options b)

Parameters

a Validate.Options

A Validate.Options instance.

b Validate.Options

Another Validate.Options instance.

Returns

bool

True if the two instances are equal.

operator !=(Options, Options)

Implements the operator !=.

public static bool operator !=(Validate.Options a, Validate.Options b)

Parameters

a Validate.Options

A Validate.Options instance.

b Validate.Options

Another Validate.Options instance.

Returns

bool

True if the two instances are not equal.