ClassAssertStyle
Assert based on common html styles.
Definition
Namespace:ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class AssertStyle : BaseControlAssert<HtmlControl>
Inheritance: objectBaseControlAssert<HtmlControl>AssertStyle
Inherited Members
Constructors
AssertStyle(HtmlControl)
Create a new AssertStyle object passing it the target control.
Declaration
public AssertStyle(HtmlControl control)
Parameters
control
The target control to assign to this AssertStyle object.
AssertStyle(bool)
Create a new AssertStyle object.
Declaration
public AssertStyle(bool throwOnFailure)
Parameters
throwOnFailure
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
public HtmlStyleType DefaultStyleType { get; set; }
Property Value
Methods
Box(HtmlStyleBox, string)
Assert Box styles.
Declaration
public bool Box(HtmlStyleBox styleName, string expectedValue)
Parameters
styleName
The style name.
expectedValue
The expected value.
Returns
True if the values match else will throw an AssertException.
Box(HtmlStyleBox, string, HtmlStyleType)
Assert Box styles.
Declaration
public bool Box(HtmlStyleBox styleName, string expectedValue, HtmlStyleType styleType)
Parameters
styleName
The style name.
expectedValue
The expected value.
styleType
Either computed or inline.
Returns
True if the values match else will throw an AssertException.
Box(HtmlStyleBox, string, HtmlStyleType, StringCompareType)
Assert Box styles.
Declaration
public bool Box(HtmlStyleBox styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)
Parameters
styleName
The style name.
expectedValue
The expected value.
styleType
Either computed or inline.
compareType
String compare type.
Returns
True if the values match else will throw an AssertException.
ColorAndBackground(HtmlStyleColorAndBackground, string)
Assert Color/Background styles.
Declaration
public bool ColorAndBackground(HtmlStyleColorAndBackground styleName, string expectedValue)
Parameters
styleName
The color or background style.
expectedValue
The expected style value.
Returns
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
public bool ColorAndBackground(HtmlStyleColorAndBackground styleName, string expectedValue, HtmlStyleType styleType)
Parameters
styleName
The color or background style.
expectedValue
The expected style value.
styleType
Either computed or inline.
Returns
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
public bool ColorAndBackground(HtmlStyleColorAndBackground styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)
Parameters
styleName
The color or background style.
expectedValue
The expected style value.
styleType
Either computed or inline.
compareType
String Compare Type
Returns
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
public bool Display(HtmlStyleDisplay styleName, string expectedValue)
Parameters
styleName
The style name.
expectedValue
The expected value.
Returns
True if the values match else will throw an AssertException.
Display(HtmlStyleDisplay, string, HtmlStyleType)
Assert Display styles.
Declaration
public bool Display(HtmlStyleDisplay styleName, string expectedValue, HtmlStyleType styleType)
Parameters
styleName
The font style name.
expectedValue
The expected value.
styleType
Either computed or inline.
Returns
True if the values match else will throw an AssertException.
Display(HtmlStyleDisplay, string, HtmlStyleType, StringCompareType)
Assert Display styles.
Declaration
public bool Display(HtmlStyleDisplay styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)
Parameters
styleName
The font style name.
expectedValue
The expected value.
styleType
Either computed or inline.
compareType
String compare type
Returns
True if the values match else will throw an AssertException.
Font(HtmlStyleFont, string)
Assert Font styles.
Declaration
public bool Font(HtmlStyleFont styleName, string expectedValue)
Parameters
styleName
The font style name.
expectedValue
The expected value.
Returns
True if the values match else will throw an AssertException.
Font(HtmlStyleFont, string, HtmlStyleType)
Assert Font styles.
Declaration
public bool Font(HtmlStyleFont styleName, string expectedValue, HtmlStyleType styleType)
Parameters
styleName
The font style name.
expectedValue
The expected value.
styleType
Either computed or inline.
Returns
True if the values match else will throw an AssertException.
Font(HtmlStyleFont, string, HtmlStyleType, StringCompareType)
Assert Font styles.
Declaration
public bool Font(HtmlStyleFont styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)
Parameters
styleName
The font style name.
expectedValue
The expected value.
styleType
Either computed or inline.
compareType
String compare type.
Returns
True if the values match else will throw an AssertException.
List(HtmlStyleList, string)
Assert List styles.
Declaration
public bool List(HtmlStyleList styleName, string expectedValue)
Parameters
styleName
The style name.
expectedValue
The expected value.
Returns
True if the values match else will throw an AssertException.
List(HtmlStyleList, string, HtmlStyleType)
Assert List styles.
Declaration
public bool List(HtmlStyleList styleName, string expectedValue, HtmlStyleType styleType)
Parameters
styleName
The style name.
expectedValue
The expected value.
styleType
Either computed or inline.
Returns
True if the values match else will throw an AssertException.
List(HtmlStyleList, string, HtmlStyleType, StringCompareType)
Assert List styles.
Declaration
public bool List(HtmlStyleList styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)
Parameters
styleName
The style name.
expectedValue
The expected value.
styleType
Either computed or inline.
compareType
String compare type
Returns
True if the values match else will throw an AssertException.
Text(HtmlStyleText, string)
Assert Text styles.
Declaration
public bool Text(HtmlStyleText styleName, string expectedValue)
Parameters
styleName
The style name.
expectedValue
The expected value.
Returns
True if the values match else will throw an AssertException.
Text(HtmlStyleText, string, HtmlStyleType)
Assert Text styles.
Declaration
public bool Text(HtmlStyleText styleName, string expectedValue, HtmlStyleType styleType)
Parameters
styleName
The style name.
expectedValue
The expected value.
styleType
Either computed or inline.
Returns
True if the values match else will throw an AssertException.
Text(HtmlStyleText, string, HtmlStyleType, StringCompareType)
Assert Text styles.
Declaration
public bool Text(HtmlStyleText styleName, string expectedValue, HtmlStyleType styleType, StringCompareType compareType)
Parameters
styleName
The style name.
expectedValue
The expected value.
styleType
Either computed or inline.
compareType
String compare type
Returns
True if the values match else will throw an AssertException.