import Sinon = require("sinon"); import BluebirdPromise = require("bluebird"); import { ILdapClient } from "../../../src/lib/ldap/ILdapClient"; export class LdapClientStub implements ILdapClient { bindAsyncStub: Sinon.SinonStub; unbindAsyncStub: Sinon.SinonStub; searchAsyncStub: Sinon.SinonStub; modifyAsyncStub: Sinon.SinonStub; constructor() { this.bindAsyncStub = Sinon.stub(); this.unbindAsyncStub = Sinon.stub(); this.searchAsyncStub = Sinon.stub(); this.modifyAsyncStub = Sinon.stub(); } bindAsync(username: string, password: string): BluebirdPromise { return this.bindAsyncStub(username, password); } unbindAsync(): BluebirdPromise { return this.unbindAsyncStub(); } searchAsync(base: string, query: any): BluebirdPromise { return this.searchAsyncStub(base, query); } modifyAsync(dn: string, changeRequest: any): BluebirdPromise { return this.modifyAsyncStub(dn, changeRequest); } }