2017-05-20 23:15:34 +00:00
|
|
|
|
2018-04-26 21:20:10 +00:00
|
|
|
import Sinon = require("sinon");
|
2017-05-20 23:15:34 +00:00
|
|
|
|
2018-04-26 21:20:10 +00:00
|
|
|
export class LdapjsMock {
|
|
|
|
createClientStub: sinon.SinonStub;
|
2017-05-20 23:15:34 +00:00
|
|
|
|
2018-04-26 21:20:10 +00:00
|
|
|
constructor() {
|
|
|
|
this.createClientStub = Sinon.stub();
|
|
|
|
}
|
2017-05-20 23:15:34 +00:00
|
|
|
|
2018-04-26 21:20:10 +00:00
|
|
|
createClient(params: any) {
|
|
|
|
return this.createClientStub(params);
|
|
|
|
}
|
2017-05-20 23:15:34 +00:00
|
|
|
}
|
|
|
|
|
2018-04-26 21:20:10 +00: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-20 23:15:34 +00:00
|
|
|
}
|