MockContainerRuntime Class
Mock implementation of ContainerRuntime 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.
Signature
export declare class MockContainerRuntime
Constructors
Constructor | Description |
---|---|
(constructor)(dataStoreRuntime, factory) | Constructs a new instance of the MockContainerRuntime class |
Properties
Property | Type | Description |
---|---|---|
clientId | string | |
clientSequenceNumber | number | |
dataStoreRuntime | MockFluidDataStoreRuntime | |
deltaConnections | MockDeltaConnection[] | |
factory | MockContainerRuntimeFactory | |
pendingMessages | IMockContainerRuntimePendingMessage[] |
Methods
Method | Return Type | Description |
---|---|---|
addPendingMessage(content, localOpMetadata, clientSequenceNumber) | void | |
createDeltaConnection() | MockDeltaConnection | |
dirty() | void | |
process(message) | void | |
submit(messageContent, localOpMetadata) | number |
Constructor Details
(constructor)
Constructs a new instance of the MockContainerRuntime
class
Signature
constructor(dataStoreRuntime: MockFluidDataStoreRuntime, factory: MockContainerRuntimeFactory);
Parameters
Parameter | Type | Description |
---|---|---|
dataStoreRuntime | MockFluidDataStoreRuntime | |
factory | MockContainerRuntimeFactory |
Property Details
clientId
Signature
clientId: string;
Type: string
clientSequenceNumber
Signature
protected clientSequenceNumber: number;
Type: number
dataStoreRuntime
Signature
protected readonly dataStoreRuntime: MockFluidDataStoreRuntime;
Type: MockFluidDataStoreRuntime
deltaConnections
Signature
protected readonly deltaConnections: MockDeltaConnection[];
Type: MockDeltaConnection[]
factory
Signature
protected readonly factory: MockContainerRuntimeFactory;
Type: MockContainerRuntimeFactory
pendingMessages
Signature
protected readonly pendingMessages: IMockContainerRuntimePendingMessage[];
Type: IMockContainerRuntimePendingMessage[]
Method Details
addPendingMessage
Signature
protected addPendingMessage(content: any, localOpMetadata: unknown, clientSequenceNumber: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
content | any | |
localOpMetadata | unknown | |
clientSequenceNumber | number |
createDeltaConnection
Signature
createDeltaConnection(): MockDeltaConnection;
Returns
Return type: MockDeltaConnection
dirty
Signature
dirty(): void;
process
Signature
process(message: ISequencedDocumentMessage): void;
Parameters
Parameter | Type | Description |
---|---|---|
message | ISequencedDocumentMessage |
submit
Signature
submit(messageContent: any, localOpMetadata: unknown): number;
Parameters
Parameter | Type | Description |
---|---|---|
messageContent | any | |
localOpMetadata | unknown |
Returns
Return type: number