Class FakeOpenShellClient
An in-memory IOpenShellClient for unit tests. It keeps realistic state (workspace-scoped stores, name uniqueness, resource versions, pagination, phase transitions, watch streams) and raises the same OpenShellException kinds as the real client, with no network access.
public sealed class FakeOpenShellClient : IOpenShellClient, IDisposable
- Inheritance
-
FakeOpenShellClient
- Implements
- Inherited Members
Remarks
Use Gateway to inspect recorded calls, inject failures, script command results and drive time. Views created with InWorkspace(string) share the same state.
Constructors
FakeOpenShellClient(FakeGateway, string?)
Creates a client view over an existing gateway; disposing the view leaves the gateway alone.
public FakeOpenShellClient(FakeGateway gateway, string? workspace = null)
Parameters
gatewayFakeGatewayThe shared state.
workspacestringThe workspace for this view; defaults to the gateway's default workspace.
FakeOpenShellClient(FakeGatewayOptions?)
Creates a client over a new gateway that it disposes with itself.
public FakeOpenShellClient(FakeGatewayOptions? options = null)
Parameters
optionsFakeGatewayOptions
Properties
Config
Sandbox and gateway configuration.
public IConfigClient Config { get; }
Property Value
Exec
Command execution.
public IExecClient Exec { get; }
Property Value
Files
File transfer.
public IFileClient Files { get; }
Property Value
Gateway
The state and test hooks behind this client.
public FakeGateway Gateway { get; }
Property Value
Health
Health and identity.
public IHealthClient Health { get; }
Property Value
Policy
Draft policy review and policy revisions.
public IPolicyClient Policy { get; }
Property Value
Providers
Providers, profiles and credential refresh.
public IProviderClient Providers { get; }
Property Value
Rootfs
Local rootfs tar staging for drivers that boot from an archive.
public IRootfsClient Rootfs { get; }
Property Value
SandboxProviders
Provider attachment and readiness for sandboxes.
public ISandboxProviderClient SandboxProviders { get; }
Property Value
Sandboxes
Sandbox lifecycle.
public ISandboxClient Sandboxes { get; }
Property Value
Services
Service exposure.
public IServiceClient Services { get; }
Property Value
Ssh
SSH relay sessions and tunnels.
public ISshClient Ssh { get; }
Property Value
Tcp
TCP forwarding to sandbox ports.
public ITcpClient Tcp { get; }
Property Value
Templates
Reusable sandbox workload templates.
public ISandboxTemplateClient Templates { get; }
Property Value
Watch
Watch streams and logs.
public ISandboxWatchClient Watch { get; }
Property Value
Workspace
The workspace this view operates in.
public string Workspace { get; }
Property Value
Workspaces
Workspace and membership management.
public IWorkspaceClient Workspaces { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
InWorkspace(string)
Returns a view of this client bound to another workspace; the connection is shared.
public IOpenShellClient InWorkspace(string workspace)
Parameters
workspacestring