2017-10-08 05:46:57 +07:00
|
|
|
import { IMailSenderBuilder } from "../../../src/lib/notifiers/IMailSenderBuilder";
|
|
|
|
import BluebirdPromise = require("bluebird");
|
|
|
|
import Nodemailer = require("nodemailer");
|
|
|
|
import Sinon = require("sinon");
|
|
|
|
import { IMailSender } from "../../../src/lib/notifiers/IMailSender";
|
2017-10-25 15:28:56 +07:00
|
|
|
import { SmtpNotifierConfiguration, EmailNotifierConfiguration } from "../../../src/lib/configuration/Configuration";
|
2017-10-08 05:46:57 +07:00
|
|
|
|
|
|
|
export class MailSenderBuilderStub implements IMailSenderBuilder {
|
2017-10-25 15:28:56 +07:00
|
|
|
buildEmailStub: Sinon.SinonStub;
|
2017-10-08 05:46:57 +07:00
|
|
|
buildSmtpStub: Sinon.SinonStub;
|
|
|
|
|
|
|
|
constructor() {
|
2017-10-25 15:28:56 +07:00
|
|
|
this.buildEmailStub = Sinon.stub();
|
2017-10-08 05:46:57 +07:00
|
|
|
this.buildSmtpStub = Sinon.stub();
|
|
|
|
}
|
|
|
|
|
2017-10-25 15:28:56 +07:00
|
|
|
buildEmail(options: EmailNotifierConfiguration): IMailSender {
|
|
|
|
return this.buildEmailStub(options);
|
2017-10-08 05:46:57 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
buildSmtp(options: SmtpNotifierConfiguration): IMailSender {
|
|
|
|
return this.buildSmtpStub(options);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|