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
stringThe version string
isPresumed
boolWhether 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
Methods
CompareTo(BrowserVersion)
public override int CompareTo(BrowserVersion other)
Parameters
other
BrowserVersion
Returns
Equals(BrowserVersion)
public override bool Equals(BrowserVersion other)
Parameters
other
BrowserVersion
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
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
stringThe version string
result
UnrecognisedBrowserVersionExposes the result when this method returns true
isPresumed
boolWhether or not this is a presumed version; see IsPresumedVersion