2017-08-05 02:20:31 +07:00
|
|
|
|
|
|
|
import Sinon = require("sinon");
|
2017-10-07 05:09:42 +07:00
|
|
|
import { INotifier } from "../../src/lib/INotifier";
|
2017-08-05 02:20:31 +07:00
|
|
|
|
|
|
|
export class NotifierStub implements INotifier {
|
|
|
|
successStub: Sinon.SinonStub;
|
|
|
|
errorStub: Sinon.SinonStub;
|
|
|
|
warnStub: Sinon.SinonStub;
|
|
|
|
infoStub: Sinon.SinonStub;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
this.successStub = Sinon.stub();
|
|
|
|
this.errorStub = Sinon.stub();
|
|
|
|
this.warnStub = Sinon.stub();
|
|
|
|
this.infoStub = Sinon.stub();
|
|
|
|
}
|
|
|
|
|
|
|
|
success(msg: string) {
|
|
|
|
this.successStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
error(msg: string) {
|
|
|
|
this.errorStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
warning(msg: string) {
|
|
|
|
this.warnStub();
|
|
|
|
}
|
|
|
|
|
|
|
|
info(msg: string) {
|
|
|
|
this.infoStub();
|
|
|
|
}
|
|
|
|
}
|