Table of Contents

Class FakeOpenShellClient

Namespace
OpenShell.Testing
Assembly
OpenShell.Sdk.Testing.dll

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

gateway FakeGateway

The shared state.

workspace string

The 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

options FakeGatewayOptions

Properties

Config

Sandbox and gateway configuration.

public IConfigClient Config { get; }

Property Value

IConfigClient

Exec

Command execution.

public IExecClient Exec { get; }

Property Value

IExecClient

Files

File transfer.

public IFileClient Files { get; }

Property Value

IFileClient

Gateway

The state and test hooks behind this client.

public FakeGateway Gateway { get; }

Property Value

FakeGateway

Health

Health and identity.

public IHealthClient Health { get; }

Property Value

IHealthClient

Policy

Draft policy review and policy revisions.

public IPolicyClient Policy { get; }

Property Value

IPolicyClient

Providers

Providers, profiles and credential refresh.

public IProviderClient Providers { get; }

Property Value

IProviderClient

Rootfs

Local rootfs tar staging for drivers that boot from an archive.

public IRootfsClient Rootfs { get; }

Property Value

IRootfsClient

SandboxProviders

Provider attachment and readiness for sandboxes.

public ISandboxProviderClient SandboxProviders { get; }

Property Value

ISandboxProviderClient

Sandboxes

Sandbox lifecycle.

public ISandboxClient Sandboxes { get; }

Property Value

ISandboxClient

Services

Service exposure.

public IServiceClient Services { get; }

Property Value

IServiceClient

Ssh

SSH relay sessions and tunnels.

public ISshClient Ssh { get; }

Property Value

ISshClient

Tcp

TCP forwarding to sandbox ports.

public ITcpClient Tcp { get; }

Property Value

ITcpClient

Templates

Reusable sandbox workload templates.

public ISandboxTemplateClient Templates { get; }

Property Value

ISandboxTemplateClient

Watch

Watch streams and logs.

public ISandboxWatchClient Watch { get; }

Property Value

ISandboxWatchClient

Workspace

The workspace this view operates in.

public string Workspace { get; }

Property Value

string

Workspaces

Workspace and membership management.

public IWorkspaceClient Workspaces { get; }

Property Value

IWorkspaceClient

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

workspace string

Returns

IOpenShellClient