fakexrmeasy
Version:
This project aims to provide mocks already implemented for Web API calls made from Javascript. This is a work in progress and way less mature than [its C# counterpart](https://github.com/jordimontana82/fake-xrm-easy).
36 lines (35 loc) • 1.98 kB
TypeScript
import * as Enumerable from 'linq';
import { IXrmFakedContext } from './IXrmFakedContext';
import IFakeXmlHttpRequest from './IFakeXmlHttpRequest';
import IODataUrlParser from './IODataUrlParser';
import ODataParsedUrl from './ODataParsedUrl';
import Dictionary from './Dictionary';
import { IEntity } from './IEntity';
import IFakeMessageExecutor from './IFakeMessageExecutor';
export declare class XrmFakedContext implements IXrmFakedContext {
readonly _apiVersion: string;
readonly _fakeAbsoluteUrlPrefix: string;
readonly _oDataUrlParser: IODataUrlParser;
private _executors;
private _data;
constructor(apiVersion: string, fakeAbsoluteUrlPrefix: string, autoMockGlobalNamespace?: boolean);
protected setupGlobalMock(): void;
initialize(entities: Array<IEntity>): void;
getEntity(logicalName: string, id: string): IEntity;
addEntity(entity: IEntity): string;
removeEntity(logicalName: string, id: string): void;
updateEntity(entity: IEntity): void;
replaceEntity(entity: IEntity): void;
createQuery(logicalName: string): Enumerable.IEnumerable<IEntity>;
protected getAllData(): Dictionary<Dictionary<IEntity>>;
protected executeRequest(fakeXhr: IFakeXmlHttpRequest): void;
addFakeMessageExecutor(executor: IFakeMessageExecutor): void;
protected executePostRequest(fakeXhr: IFakeXmlHttpRequest): void;
protected executePatchRequest(fakeXhr: IFakeXmlHttpRequest): void;
protected executeDeleteRequest(fakeXhr: IFakeXmlHttpRequest): void;
protected executeGetRequest(fakeXhr: IFakeXmlHttpRequest): void;
protected getSingularSetName(pluralEntitySetName: string): string;
protected executeQuery(entityName: string, parsedQuery: ODataParsedUrl): Array<IEntity>;
protected findExecutorFor(relativeUrl: string, method: string): IFakeMessageExecutor;
protected executeCustomExecutor(executor: IFakeMessageExecutor, fakeXhr: IFakeXmlHttpRequest): void;
}