MockDeltaConnection Class
Mock implementation of IDeltaConnection for testing
Signature
export declare class MockDeltaConnection implements IDeltaConnection
Implements: IDeltaConnection
Constructors
| Constructor | Description | 
|---|---|
| (constructor)(submitFn, dirtyFn) | Constructs a new instance of the MockDeltaConnection class | 
  
Properties
| Property | Type | Description | 
|---|---|---|
| connected | boolean | |
| handler | IDeltaHandler | undefined | 
Methods
| Method | Return Type | Description | 
|---|---|---|
| attach(handler) | void | |
| dirty() | void | |
| process(message, local, localOpMetadata) | void | |
| reSubmit(content, localOpMetadata) | void | |
| setConnectionState(connected) | void | |
| submit(messageContent, localOpMetadata) | number | 
Constructor Details
(constructor)
Constructs a new instance of the MockDeltaConnection class
Signature
constructor(submitFn: (messageContent: any, localOpMetadata: unknown) => number, dirtyFn: () => void);
Parameters
| Parameter | Type | Description | 
|---|---|---|
| submitFn | (messageContent: any, localOpMetadata: unknown) => number | |
| dirtyFn | () => void | 
Property Details
connected
Signature
get connected(): boolean;
Type: boolean
handler
Signature
handler: IDeltaHandler | undefined;
Type: IDeltaHandler | undefined
Method Details
attach
Signature
attach(handler: IDeltaHandler): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| handler | IDeltaHandler | 
dirty
Signature
dirty(): void;
process
Signature
process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| message | ISequencedDocumentMessage | |
| local | boolean | |
| localOpMetadata | unknown | 
reSubmit
Signature
reSubmit(content: any, localOpMetadata: unknown): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| content | any | |
| localOpMetadata | unknown | 
setConnectionState
Signature
setConnectionState(connected: boolean): void;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| connected | boolean | 
submit
Signature
submit(messageContent: any, localOpMetadata: unknown): number;
Parameters
| Parameter | Type | Description | 
|---|---|---|
| messageContent | any | |
| localOpMetadata | unknown | 
Returns
Return type: number