Skip to main content

MockContainerRuntime Class

Mock implementation of IContainerRuntime for testing basic submitting and processing of messages. If test specific logic is required, extend this class and add the logic there. For an example, take a look at MockContainerRuntimeForReconnection.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/test-runtime-utils/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class MockContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents>

Extends: TypedEventEmitter<IContainerRuntimeEvents>

Constructors

Constructor Alerts Description
(constructor)(dataStoreRuntime, factory, mockContainerRuntimeOptions, overrides) Alpha Constructs a new instance of the MockContainerRuntime class

Properties

Property Alerts Modifiers Type Description
clientId Alpha string
dataStoreRuntime Alpha readonly MockFluidDataStoreRuntime
deltaConnections Deprecated, Alpha readonly MockDeltaConnection[]
deltaManager Alpha readonly MockDeltaManager
factory Alpha readonly MockContainerRuntimeFactory
isDirty Alpha readonly boolean
outbox Alpha readonly IInternalMockRuntimeMessage[]
overrides Alpha optional, readonly { minimumSequenceNumber?: number | undefined; } | undefined
pendingMessages Alpha readonly IMockContainerRuntimePendingMessage[]
runtimeOptions Alpha readonly Required<IMockContainerRuntimeOptions> The runtime options this instance is using. See IMockContainerRuntimeOptions.

Constructor Details

(constructor)

Constructs a new instance of the MockContainerRuntime class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

constructor(dataStoreRuntime: MockFluidDataStoreRuntime, factory: MockContainerRuntimeFactory, mockContainerRuntimeOptions?: IMockContainerRuntimeOptions, overrides?: {
minimumSequenceNumber?: number | undefined;
} | undefined);

Parameters

Parameter Modifiers Type Description
dataStoreRuntime MockFluidDataStoreRuntime
factory MockContainerRuntimeFactory
mockContainerRuntimeOptions optional IMockContainerRuntimeOptions
overrides optional { minimumSequenceNumber?: number | undefined; } | undefined

Property Details

clientId

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

clientId: string;

Type: string

dataStoreRuntime

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly dataStoreRuntime: MockFluidDataStoreRuntime;

Type: MockFluidDataStoreRuntime

deltaConnections

This API is deprecated and will be removed in a future release.

use the associated datastore to create the delta connection

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly deltaConnections: MockDeltaConnection[];

Type: MockDeltaConnection[]

deltaManager

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly deltaManager: MockDeltaManager;

Type: MockDeltaManager

factory

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly factory: MockContainerRuntimeFactory;

Type: MockContainerRuntimeFactory

isDirty

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

get isDirty(): boolean;

Type: boolean

outbox

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly outbox: IInternalMockRuntimeMessage[];

Type: IInternalMockRuntimeMessage[]

overrides

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly overrides?: {
minimumSequenceNumber?: number | undefined;
} | undefined;

Type: { minimumSequenceNumber?: number | undefined; } | undefined

pendingMessages

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly pendingMessages: IMockContainerRuntimePendingMessage[];

Type: IMockContainerRuntimePendingMessage[]

runtimeOptions

The runtime options this instance is using. See IMockContainerRuntimeOptions.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

protected readonly runtimeOptions: Required<IMockContainerRuntimeOptions>;

Type: Required<IMockContainerRuntimeOptions>