Class
AssertStyle

Assert based on common html styles.

Definition

Namespace:ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class AssertStyle : BaseControlAssert<HtmlControl>

Inheritance: objectBaseControlAssert<HtmlControl>AssertStyle

Inherited Members BaseControlAssert<HtmlControl>.NotFoundBaseControlAssert<HtmlControl>.NumberCompareRange(int, int, int, NumberRangeCompareType)BaseControlAssert<HtmlControl>.NumberCompare(int, int, NumberCompareType)BaseControlAssert<HtmlControl>.StringCompare(string, string, StringCompareType)BaseControlAssert<HtmlControl>.AssertNumber(int, int, NumberCompareType, bool)BaseControlAssert<HtmlControl>.AssertString(string, string, StringCompareType, bool)BaseControlAssert<HtmlControl>.Assert(bool, string, string, string, bool)BaseControlAssert<HtmlControl>.Assert(bool, string, string, string)BaseControlAssert<HtmlControl>.Target

Constructors

AssertStyle()

Create a new AssertStyle object.

Declaration

cs-api-definition
public AssertStyle()

AssertStyle(HtmlControl)

Create a new AssertStyle object passing it the target control.

Declaration

cs-api-definition
public AssertStyle(HtmlControl control)

Parameters

control

HtmlControl

The target control to assign to this AssertStyle object.

AssertStyle(bool)

Create a new AssertStyle object.

Declaration

cs-api-definition
public AssertStyle(bool throwOnFailure)

Parameters

throwOnFailure

bool

Whether this object throws an exception is a check fails

Properties

DefaultStyleType

Gets or sets the default style type to use (Inline or Computed). Defaults to Computed.

Declaration

cs-api-definition
public HtmlStyleType DefaultStyleType { get; set; }

Property Value

HtmlStyleType

Methods

Box(HtmlStyleBox, string)

Assert Box styles.

Declaration

cs-api-definition
public bool Box(HtmlStyleBox styleName, string expectedValue)

Parameters

styleName

HtmlStyleBox

The style name.

expectedValue

string

The expected value.

Returns

bool

True if the values match else will throw an AssertException.

Box(HtmlStyleBox, string, HtmlStyleType)

Assert Box styles.

Declaration

cs-api-definition
public bool Box(HtmlStyleBox styleName, string expectedValue, HtmlStyleType styleType)

Parameters

styleName

HtmlStyleBox

The style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

Returns

bool

True if the values match else will throw an AssertException.

Box(HtmlStyleBox, string, HtmlStyleType, StringCompareType)

Assert Box styles.

Declaration

cs-api-definition
public bool Box(HtmlStyleBox styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)

Parameters

styleName

HtmlStyleBox

The style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

compareType

StringCompareType

String compare type.

Returns

bool

True if the values match else will throw an AssertException.

ColorAndBackground(HtmlStyleColorAndBackground, string)

Assert Color/Background styles.

Declaration

cs-api-definition
public bool ColorAndBackground(HtmlStyleColorAndBackground styleName, string expectedValue)

Parameters

styleName

HtmlStyleColorAndBackground

The color or background style.

expectedValue

string

The expected style value.

Returns

bool

True if the values match else will throw an AssertException.

Remarks

Automatically detects colors and will perform the proper validation regardless of the format of the color encoding attached to the style e.g. "red" will match "#FF0000".

ColorAndBackground(HtmlStyleColorAndBackground, string, HtmlStyleType)

Assert Color/Background styles.

Declaration

cs-api-definition
public bool ColorAndBackground(HtmlStyleColorAndBackground styleName, string expectedValue, HtmlStyleType styleType)

Parameters

styleName

HtmlStyleColorAndBackground

The color or background style.

expectedValue

string

The expected style value.

styleType

HtmlStyleType

Either computed or inline.

Returns

bool

True if the values match else will throw an AssertException.

Remarks

Automatically detects colors and will perform the proper validation regardless of the format of the color encoding attached to the style e.g. "red" will match "#FF0000".

ColorAndBackground(HtmlStyleColorAndBackground, string, HtmlStyleType, StringCompareType)

Assert Color/Background styles.

Declaration

cs-api-definition
public bool ColorAndBackground(HtmlStyleColorAndBackground styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)

Parameters

styleName

HtmlStyleColorAndBackground

The color or background style.

expectedValue

string

The expected style value.

styleType

HtmlStyleType

Either computed or inline.

compareType

StringCompareType

String Compare Type

Returns

bool

True if the values match else will throw an AssertException.

Remarks

Automatically detects colors and will perform the proper validation regardless of the format of the color encoding attached to the style e.g. "red" will match "#FF0000".

Display(HtmlStyleDisplay, string)

Assert Display styles.

Declaration

cs-api-definition
public bool Display(HtmlStyleDisplay styleName, string expectedValue)

Parameters

styleName

HtmlStyleDisplay

The style name.

expectedValue

string

The expected value.

Returns

bool

True if the values match else will throw an AssertException.

Display(HtmlStyleDisplay, string, HtmlStyleType)

Assert Display styles.

Declaration

cs-api-definition
public bool Display(HtmlStyleDisplay styleName, string expectedValue, HtmlStyleType styleType)

Parameters

styleName

HtmlStyleDisplay

The font style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

Returns

bool

True if the values match else will throw an AssertException.

Display(HtmlStyleDisplay, string, HtmlStyleType, StringCompareType)

Assert Display styles.

Declaration

cs-api-definition
public bool Display(HtmlStyleDisplay styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)

Parameters

styleName

HtmlStyleDisplay

The font style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

compareType

StringCompareType

String compare type

Returns

bool

True if the values match else will throw an AssertException.

Font(HtmlStyleFont, string)

Assert Font styles.

Declaration

cs-api-definition
public bool Font(HtmlStyleFont styleName, string expectedValue)

Parameters

styleName

HtmlStyleFont

The font style name.

expectedValue

string

The expected value.

Returns

bool

True if the values match else will throw an AssertException.

Font(HtmlStyleFont, string, HtmlStyleType)

Assert Font styles.

Declaration

cs-api-definition
public bool Font(HtmlStyleFont styleName, string expectedValue, HtmlStyleType styleType)

Parameters

styleName

HtmlStyleFont

The font style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

Returns

bool

True if the values match else will throw an AssertException.

Font(HtmlStyleFont, string, HtmlStyleType, StringCompareType)

Assert Font styles.

Declaration

cs-api-definition
public bool Font(HtmlStyleFont styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)

Parameters

styleName

HtmlStyleFont

The font style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

compareType

StringCompareType

String compare type.

Returns

bool

True if the values match else will throw an AssertException.

List(HtmlStyleList, string)

Assert List styles.

Declaration

cs-api-definition
public bool List(HtmlStyleList styleName, string expectedValue)

Parameters

styleName

HtmlStyleList

The style name.

expectedValue

string

The expected value.

Returns

bool

True if the values match else will throw an AssertException.

List(HtmlStyleList, string, HtmlStyleType)

Assert List styles.

Declaration

cs-api-definition
public bool List(HtmlStyleList styleName, string expectedValue, HtmlStyleType styleType)

Parameters

styleName

HtmlStyleList

The style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

Returns

bool

True if the values match else will throw an AssertException.

List(HtmlStyleList, string, HtmlStyleType, StringCompareType)

Assert List styles.

Declaration

cs-api-definition
public bool List(HtmlStyleList styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)

Parameters

styleName

HtmlStyleList

The style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

compareType

StringCompareType

String compare type

Returns

bool

True if the values match else will throw an AssertException.

Text(HtmlStyleText, string)

Assert Text styles.

Declaration

cs-api-definition
public bool Text(HtmlStyleText styleName, string expectedValue)

Parameters

styleName

HtmlStyleText

The style name.

expectedValue

string

The expected value.

Returns

bool

True if the values match else will throw an AssertException.

Text(HtmlStyleText, string, HtmlStyleType)

Assert Text styles.

Declaration

cs-api-definition
public bool Text(HtmlStyleText styleName, string expectedValue, HtmlStyleType styleType)

Parameters

styleName

HtmlStyleText

The style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

Returns

bool

True if the values match else will throw an AssertException.

Text(HtmlStyleText, string, HtmlStyleType, StringCompareType)

Assert Text styles.

Declaration

cs-api-definition
public bool Text(HtmlStyleText styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)

Parameters

styleName

HtmlStyleText

The style name.

expectedValue

string

The expected value.

styleType

HtmlStyleType

Either computed or inline.

compareType

StringCompareType

String compare type

Returns

bool

True if the values match else will throw an AssertException.