Class ProtoDeviceBuilder
Configures the device clients a suite talks to, mirroring the REST and GraphQL builders: a named client is declared once with how its addresses resolve, and the typed devices that use it hang off the client.
public sealed class ProtoDeviceBuilder
- Inheritance
-
ProtoDeviceBuilder
- Inherited Members
- Extension Methods
Properties
ApplicationName
Gets the application the builder was registered under, or null.
public string? ApplicationName { get; }
Property Value
Services
Gets the service collection the clients are registered into; backend packages use it.
public IServiceCollection Services { get; }
Property Value
Methods
AddClient(string, IProtoDeviceTransport, string?, Func<ProtoExecutionContext, string, string>?)
Declares a named client whose devices connect through transport.
public ProtoDeviceClientBuilder AddClient(string name, IProtoDeviceTransport transport, string? path = null, Func<ProtoExecutionContext, string, string>? resolveAddress = null)
Parameters
namestringtransportIProtoDeviceTransportpathstringresolveAddressFunc<ProtoExecutionContext, string, string>
Returns
AddClient(string, string, string?, Func<ProtoExecutionContext, string, string>?)
Declares a named client by the transport's registered name. resolveAddress
receives the running test and the device id and returns the address to connect to; build one
with ProtoDeviceAddress for the common template and application cases.
path is used instead when an in-process transport applies, so one
registration covers both modes.
public ProtoDeviceClientBuilder AddClient(string name, string transportName, string? path = null, Func<ProtoExecutionContext, string, string>? resolveAddress = null)
Parameters
namestringtransportNamestringpathstringresolveAddressFunc<ProtoExecutionContext, string, string>
Returns
AddTransport(IProtoDeviceTransport)
Registers a transport instance, for a backend the suite configured itself (or a test).
public ProtoDeviceBuilder AddTransport(IProtoDeviceTransport transport)
Parameters
transportIProtoDeviceTransport
Returns
AddTransport<TTransport>(string?)
Registers a transport backend by type. Its name defaults to the transport's own Name; a backend package registers its transport for the suite.
public ProtoDeviceBuilder AddTransport<TTransport>(string? name = null) where TTransport : class, IProtoDeviceTransport
Parameters
namestring
Returns
Type Parameters
TTransport