Class IdentifierAndName
- Namespace
- CSF.Screenplay.Performances
- Assembly
- CSF.Screenplay.Abstractions.dll
A model which indicates a unique identifier and a corresponding human-readable name.
public sealed class IdentifierAndName : IEquatable<IdentifierAndName>, IHasName
- Inheritance
-
IdentifierAndName
- Implements
- Inherited Members
Constructors
IdentifierAndName(string, string, bool)
Initialises a new instance of IdentifierAndName
public IdentifierAndName(string identifier, string name = null, bool wasIdentifierAutoGenerated = false)
Parameters
identifier
stringThe identifier for this item, which might not be human-readable
name
stringA human-readable name for this item
wasIdentifierAutoGenerated
boolA value that indicates whether or not
identifier
is an auto-generated value
Exceptions
- ArgumentNullException
If
identifier
is null
Properties
Identifier
Gets the identifier for the current item
public string Identifier { get; }
Property Value
Remarks
The identifier for an item might not be a human-readable value. It is required to uniquely identify the current item, however.
Name
Gets a human-readable name for the current item
public string Name { get; }
Property Value
Remarks
The human-readable name in this context is not mandatory, and so this property might return a null reference if no name was specified.
WasIdentifierAutoGenerated
Gets a value indicating whether or not the Identifier is an automatically-generated value or not.
public bool WasIdentifierAutoGenerated { get; }
Property Value
Remarks
Some integrations with Screenplay do not provide a suitable unique identifier for this position. In that case, because a unique identifier is required, Screenplay generates a unique identifier (the string representation of a GUID) automatically and uses it as the Identifier. Obviously, if that is the case then the identifier will have no meaning or correspondence to anything in the logic consuming Screenplay.
This property is used to indicate when this is the case; if it is true then the Identifier was randomly-generated by Screenplay.
Methods
Equals(IdentifierAndName)
public bool Equals(IdentifierAndName other)
Parameters
other
IdentifierAndName
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()