camelCaseDave/xrm-mock

View on GitHub
src/xrm-mock/lookupoptions/lookupoptions.mock.ts

Summary

Maintainability
A
3 hrs
Test Coverage
A
100%
export class LookupOptionsMock implements Xrm.LookupOptions {
  public allowMultiSelect?: boolean;
  public defaultEntityType?: string;
  public defaultViewId?: string;
  public entityTypes: string[];
  public showBarcodeScanner?: boolean;
  public viewIds?: string[];
  public disableMru?: boolean;
  public filters?: Xrm.LookupFilterOptions[];
  public searchText?: string;

  constructor(components: ILookupOptionsComponents) {
    this.allowMultiSelect = components.allowMultiSelect;
    this.defaultEntityType = components.defaultEntityType;
    this.defaultViewId = components.defaultViewId;
    this.entityTypes = components.entityTypes;
    this.showBarcodeScanner = components.showBarcodeScanner;
    this.viewIds = components.viewIds;
  }
}

export interface ILookupOptionsComponents {
  allowMultiSelect?: boolean;
  defaultEntityType?: string;
  defaultViewId?: string;
  entityTypes?: string[];
  showBarcodeScanner?: boolean;
  viewIds?: string[];
}