2017-05-21 06:15:34 +07:00
|
|
|
|
2018-04-27 04:20:10 +07:00
|
|
|
import Sinon = require("sinon");
|
2017-05-21 06:15:34 +07:00
|
|
|
|
2018-04-27 04:20:10 +07:00
|
|
|
export class LdapjsMock {
|
|
|
|
createClientStub: sinon.SinonStub;
|
2017-05-21 06:15:34 +07:00
|
|
|
|
2018-04-27 04:20:10 +07:00
|
|
|
constructor() {
|
|
|
|
this.createClientStub = Sinon.stub();
|
|
|
|
}
|
2017-05-21 06:15:34 +07:00
|
|
|
|
2018-04-27 04:20:10 +07:00
|
|
|
createClient(params: any) {
|
|
|
|
return this.createClientStub(params);
|
|
|
|
}
|
2017-05-21 06:15:34 +07:00
|
|
|
}
|
|
|
|
|
2018-04-27 04:20:10 +07:00
|
|
|
export class LdapjsClientMock {
|
|
|
|
bindStub: sinon.SinonStub;
|
|
|
|
unbindStub: sinon.SinonStub;
|
|
|
|
searchStub: sinon.SinonStub;
|
|
|
|
modifyStub: sinon.SinonStub;
|
|
|
|
onStub: sinon.SinonStub;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
this.bindStub = Sinon.stub();
|
|
|
|
this.unbindStub = Sinon.stub();
|
|
|
|
this.searchStub = Sinon.stub();
|
|
|
|
this.modifyStub = Sinon.stub();
|
|
|
|
this.onStub = Sinon.stub();
|
|
|
|
}
|
|
|
|
|
|
|
|
bind() {
|
|
|
|
return this.bindStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
unbind() {
|
|
|
|
return this.unbindStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
search() {
|
|
|
|
return this.searchStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
modify() {
|
|
|
|
return this.modifyStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
on() {
|
|
|
|
return this.onStub();
|
|
|
|
}
|
2017-05-21 06:15:34 +07:00
|
|
|
}
|