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
reportLevelOnFailureReportLevelThe 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
reportLevelOnFailureReportLevelThe report level used if the validation fails.
reportScreenshotValidate.ResultOptionA 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
reportScreenshotValidate.ResultOptionA 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
exceptionOnFailboolA 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
exceptionOnFailboolA value specifying if an exception should be thrown if the validation fails.
reportLevelOnFailureReportLevelThe 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
exceptionOnFailboolA value specifying if an exception should be thrown if the validation fails.
reportLevelOnFailureReportLevelThe report level used if the validation fails.
reportLevelOnSuccessReportLevelThe report level used if the validation succeeds.
reportScreenshotValidate.ResultOptionA 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
exceptionOnFailboolA value specifying if an exception should be thrown if the validation fails.
reportLevelOnFailureReportLevelThe report level used if the validation fails.
reportLevelOnSuccessReportLevelThe report level used if the validation succeeds.
reportScreenshotValidate.ResultOptionA value specifying whether to add a screenshot to the report.
reportSimilarityValidate.ResultOptionA value specifying whether to add similarity results to the report.
reportDifferenceImagesValidate.ResultOptionA value specifying whether to add difference images to the report.
reportExpectedAndActualImagesValidate.ResultOptionA value specifying whether to add the expected and actual images to the report.
gracePeriodDurationThe 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
exceptionOnFailboolA value specifying if an exception should be thrown if the validation fails.
reportLevelOnFailureReportLevelThe report level used if the validation fails.
reportScreenshotValidate.ResultOptionA 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
exceptionOnFailboolA value specifying if an exception should be thrown if the validation fails.
reportScreenshotValidate.ResultOptionA 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
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
trueif 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
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Exceptions
Equals(Options, Options)
Returns true if the two instances are equal.
public static bool Equals(Validate.Options a, Validate.Options b)
Parameters
Returns
- bool
Trueif the two instances are equal, otherwisefalse.
Equals(object)
Determines whether this instance is equal to obj.
public override bool Equals(object obj)
Parameters
objobjectAnother instance.
Returns
- bool
Trueif this instance is equal toobj, otherwisefalse.
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
optionsStringstringA string representing the find options.
Returns
- Validate.Options
A new Validate.Options corresponding to the given string.
Exceptions
- ArgumentNullException
If
optionsStringisnull.- FormatException
If
optionsStringhas 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
optionsStringstringA string representing the validate options.
optionsValidate.OptionsWhen this method returns, contains a Validate.Options instance if parsing succeeded,
nullotherwise.
Returns
- bool
Trueif parsing succeeded, otherwisefalse.
Operators
operator ==(Options, Options)
Implements the operator ==.
public static bool operator ==(Validate.Options a, Validate.Options b)
Parameters
aValidate.OptionsA Validate.Options instance.
bValidate.OptionsAnother Validate.Options instance.
Returns
- bool
Trueif the two instances are equal.
operator !=(Options, Options)
Implements the operator !=.
public static bool operator !=(Validate.Options a, Validate.Options b)
Parameters
aValidate.OptionsA Validate.Options instance.
bValidate.OptionsAnother Validate.Options instance.
Returns
- bool
Trueif the two instances are not equal.