ClassBaseControlAssert<T>
Represents the base of all control assert objects.
Definition
Namespace:ArtOfTest.WebAii.Controls
Assembly:ArtOfTest.WebAii.dll
Type Parameters:
T
The type of the base control.
Syntax:
public abstract class BaseControlAssert<T> where T : Control
Inheritance: objectBaseControlAssert<T>
Derived Classes:
Constructors
BaseControlAssert()
Create a new base assert.
Declaration
public BaseControlAssert()
BaseControlAssert(T)
Create a new base assert and pass it the target control
Declaration
public BaseControlAssert(T control)
Parameters
control
T
The target control
Fields
Properties
Target
Gets or sets the assert target
Declaration
public T Target { get; set; }
Property Value
T
Methods
Assert(bool, string, string, string)
Throw if condition is false.
Declaration
protected bool Assert(bool condition, string message, string expected, string actual)
Parameters
condition
The condition result from previous condition test.
message
The message to put in the assert.
expected
The Expected value to display in the assert.
actual
The Actual value to display in the assert.
Returns
True.
Exceptions
Thrown when the comparison fails.
Assert(bool, string, string, string, bool)
Throw an AssertException if conditiion is false and throwAssert is true.
Declaration
protected bool Assert(bool condition, string message, string expected, string actual, bool throwAssert)
Parameters
condition
The condition result.
message
The message.
expected
Expected value.
actual
Actual value.
throwAssert
Whether or not to throw the assert when condition is false.
Returns
Returns true/false of the condition result.
Exceptions
Thrown when the comparison fails and throwAssert is true.
AssertNumber(int, int, NumberCompareType, bool)
Common assert for a number
Declaration
protected bool AssertNumber(int leftPortion, int rightPortion, NumberCompareType compareType, bool throwOnFailure = true)
Parameters
leftPortion
The left side of the comparison.
rightPortion
The right side of the comparison.
compareType
The comparison type (Equal, Less Than, etc.).
throwOnFailure
Whether or not to throw exception when condition is false.
Returns
True.
Exceptions
Thrown when the comparison fails.
AssertString(string, string, StringCompareType, bool)
Commnon assert for strings.
Declaration
protected bool AssertString(string expected, string actual, StringCompareType compareType, bool throwOnFailure = true)
Parameters
expected
The expected value.
actual
The actual value.
compareType
The compare type (Contains, Exact, etc.).
throwOnFailure
Returns
True.
Exceptions
Thrown when the comparison fails.
NumberCompare(int, int, NumberCompareType)
Do numerical comparison
Declaration
public static bool NumberCompare(int leftPortion, int rightPortion, NumberCompareType compareType)
Parameters
leftPortion
Left side
rightPortion
Right side
compareType
The compare type.
Returns
True/False whether the compare passed
NumberCompareRange(int, int, int, NumberRangeCompareType)
Do numberical range comparison.
Declaration
public static bool NumberCompareRange(int number, int lowerEnd, int upperEnd, NumberRangeCompareType compareType)
Parameters
number
The number to compare.
lowerEnd
The lower end of the range.
upperEnd
The upper end of the range.
compareType
The compare type.
Returns
True/False whether the comparison passed.
StringCompare(string, string, StringCompareType)
Perform a string comparison
Declaration
public static bool StringCompare(string a, string b, StringCompareType compareType)
Parameters
a
The first string.
b
The string to compare to.
compareType
The comparison type.
Returns
True/False whether the comparison passed