Class
BaseControlAssert<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:

cs-api-definition
public abstract class BaseControlAssert<T> where T : Control

Inheritance: objectBaseControlAssert<T>

Derived Classes: AssertAttributeAssertCheckAssertContentAssertSelectAssertStyleAssertTableKendoControlAssertRadControlAssert

Constructors

BaseControlAssert()

Create a new base assert.

Declaration

cs-api-definition
public BaseControlAssert()

BaseControlAssert(T)

Create a new base assert and pass it the target control

Declaration

cs-api-definition
public BaseControlAssert(T control)

Parameters

control

T

The target control

Fields

NotFound

Not found constant string.

Declaration

cs-api-definition
protected static readonly string NotFound

Field Value

string

Properties

Target

Gets or sets the assert target

Declaration

cs-api-definition
public T Target { get; set; }

Property Value

T

Methods

Assert(bool, string, string, string)

Throw if condition is false.

Declaration

cs-api-definition
protected bool Assert(bool condition, string message, string expected, string actual)

Parameters

condition

bool

The condition result from previous condition test.

message

string

The message to put in the assert.

expected

string

The Expected value to display in the assert.

actual

string

The Actual value to display in the assert.

Returns

bool

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

cs-api-definition
protected bool Assert(bool condition, string message, string expected, string actual, bool throwAssert)

Parameters

condition

bool

The condition result.

message

string

The message.

expected

string

Expected value.

actual

string

Actual value.

throwAssert

bool

Whether or not to throw the assert when condition is false.

Returns

bool

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

cs-api-definition
protected bool AssertNumber(int leftPortion, int rightPortion, NumberCompareType compareType, bool throwOnFailure = true)

Parameters

leftPortion

int

The left side of the comparison.

rightPortion

int

The right side of the comparison.

compareType

NumberCompareType

The comparison type (Equal, Less Than, etc.).

throwOnFailure

bool

Whether or not to throw exception when condition is false.

Returns

bool

True.

Exceptions

Thrown when the comparison fails.

AssertString(string, string, StringCompareType, bool)

Commnon assert for strings.

Declaration

cs-api-definition
protected bool AssertString(string expected, string actual, StringCompareType compareType, bool throwOnFailure = true)

Parameters

expected

string

The expected value.

actual

string

The actual value.

compareType

StringCompareType

The compare type (Contains, Exact, etc.).

throwOnFailure

bool

Returns

bool

True.

Exceptions

Thrown when the comparison fails.

NumberCompare(int, int, NumberCompareType)

Do numerical comparison

Declaration

cs-api-definition
public static bool NumberCompare(int leftPortion, int rightPortion, NumberCompareType compareType)

Parameters

leftPortion

int

Left side

rightPortion

int

Right side

compareType

NumberCompareType

The compare type.

Returns

bool

True/False whether the compare passed

NumberCompareRange(int, int, int, NumberRangeCompareType)

Do numberical range comparison.

Declaration

cs-api-definition
public static bool NumberCompareRange(int number, int lowerEnd, int upperEnd, NumberRangeCompareType compareType)

Parameters

number

int

The number to compare.

lowerEnd

int

The lower end of the range.

upperEnd

int

The upper end of the range.

compareType

NumberRangeCompareType

The compare type.

Returns

bool

True/False whether the comparison passed.

StringCompare(string, string, StringCompareType)

Perform a string comparison

Declaration

cs-api-definition
public static bool StringCompare(string a, string b, StringCompareType compareType)

Parameters

a

string

The first string.

b

string

The string to compare to.

compareType

StringCompareType

The comparison type.

Returns

bool

True/False whether the comparison passed