Class NamedUri
- Namespace
- CSF.Screenplay.Selenium
- Assembly
- CSF.Screenplay.Selenium.dll
Model containing a Uri with a corresponding human-readable name.
public sealed class NamedUri : IHasName
- Inheritance
-
NamedUri
- Implements
- Inherited Members
Remarks
This model allows for the association of human-readable names with URIs. This is most useful when making use of Screenplay reports, where the human-readable name can be used to describe the URI in a more user-friendly way.
Note the inclusion of implicit conversion operators which allow for seamless conversion from Uri and/or string instances to instances of this type.
Constructors
NamedUri(string, string)
Initializes a new instance of the NamedUri class.
public NamedUri(string uri, string name = null)
Parameters
uristringThe URI to associate with this instance.
namestringThe human-readable name for the URI. If null, the URI string will be used as the name.
NamedUri(Uri, string)
Initializes a new instance of the NamedUri class.
public NamedUri(Uri uri, string name = null)
Parameters
uriUriThe URI to associate with this instance.
namestringThe human-readable name for the URI. If null, the URI string will be used as the name.
Properties
Name
Gets the human-readable name for this Uri.
public string Name { get; }
Property Value
Uri
Gets the Uri associated with this instance.
public Uri Uri { get; }
Property Value
Operators
implicit operator NamedUri(string)
public static implicit operator NamedUri(string uri)
Parameters
uristringThe URI to convert.
Returns
implicit operator NamedUri(Uri)
public static implicit operator NamedUri(Uri uri)
Parameters
uriUriThe URI to convert.