2017-10-07 22:46:57 +00: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 08:28:56 +00:00
|
|
|
import { SmtpNotifierConfiguration, EmailNotifierConfiguration } from "../../../src/lib/configuration/Configuration";
|
2017-10-07 22:46:57 +00:00
|
|
|
|
|
|
|
export class MailSenderBuilderStub implements IMailSenderBuilder {
|
2017-10-25 08:28:56 +00:00
|
|
|
buildEmailStub: Sinon.SinonStub;
|
2017-10-07 22:46:57 +00:00
|
|
|
buildSmtpStub: Sinon.SinonStub;
|
|
|
|
|
|
|
|
constructor() {
|
2017-10-25 08:28:56 +00:00
|
|
|
this.buildEmailStub = Sinon.stub();
|
2017-10-07 22:46:57 +00:00
|
|
|
this.buildSmtpStub = Sinon.stub();
|
|
|
|
}
|
|
|
|
|
2017-10-25 08:28:56 +00:00
|
|
|
buildEmail(options: EmailNotifierConfiguration): IMailSender {
|
|
|
|
return this.buildEmailStub(options);
|
2017-10-07 22:46:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
buildSmtp(options: SmtpNotifierConfiguration): IMailSender {
|
|
|
|
return this.buildSmtpStub(options);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|