Table of Contents

Class UnrecognisedBrowserVersion

Namespace
CSF.Extensions.WebDriver.Identification
Assembly
CSF.Extensions.WebDriver.dll

Implementation of BrowserVersion which works for any non-empty/non-null string representation of a version.

public sealed class UnrecognisedBrowserVersion : BrowserVersion, IEquatable<BrowserVersion>, IComparable<BrowserVersion>
Inheritance
UnrecognisedBrowserVersion
Implements
Inherited Members

Remarks

This is a very weak way to represent a version and should be used only as a fall-back when a web driver does not offer a better version representation, such as one which would be compatible with either SemanticBrowserVersion or DottedNumericBrowserVersion.

Equality with another UnrecognisedBrowserVersion is performed using a culture-insensitive match of the Version property values. Sorting/comparison is also performed based upon the culture-invariant sort order of the version strings, which is unlikely to be very useful.

Constructors

UnrecognisedBrowserVersion(string, bool)

Initialises a new instance of UnrecognisedBrowserVersion.

public UnrecognisedBrowserVersion(string version, bool isPresumed = false)

Parameters

version string

The version string

isPresumed bool

Whether or not this is a presumed version; see IsPresumedVersion.

Exceptions

ArgumentException

If version is null or an empty string.

Properties

Version

Gets the version string with which the current instance was initialised.

public string Version { get; }

Property Value

string

Methods

CompareTo(BrowserVersion)

public override int CompareTo(BrowserVersion other)

Parameters

other BrowserVersion

Returns

int

Equals(BrowserVersion)

public override bool Equals(BrowserVersion other)

Parameters

other BrowserVersion

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

TryParse(string, out UnrecognisedBrowserVersion, bool)

Attempts to parse the specified version string as a UnrecognisedBrowserVersion.

public static bool TryParse(string version, out UnrecognisedBrowserVersion result, bool isPresumed = false)

Parameters

version string

The version string

result UnrecognisedBrowserVersion

Exposes the result when this method returns true

isPresumed bool

Whether or not this is a presumed version; see IsPresumedVersion

Returns

bool

true if the parsing succeeded; false if not.