Пример #1
0
        public void ShoudSendEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = TokenGenerator.CreateActivationEmailTokens(),
                MessageType = MessageTypes.SendActivationCode
            };

            _dispatcher.SendEmail(request);

            _logServiceMock.Verify(l => l.Error(It.IsAny <string>(), It.IsAny <Exception>()), Times.Never);
        }
Пример #2
0
        public void ShouldSendPasswordResetConfirmationEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = TokenGenerator.CreatePasswordResetConfirmationTokens(),
                MessageType = MessageTypes.PasswordChanged
            };

            _dispatcher.SendEmail(request);

            _logServiceMock.Verify(l => l.Error(It.IsAny <string>(), It.IsAny <Exception>()), Times.Never);
        }
Пример #3
0
        public void ShouldSendDailyDigestEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = TokenGenerator.CreateVacanciesAboutToExpireTokens(4),
                MessageType = MessageTypes.DailyDigest
            };

            _dispatcher.SendEmail(request);

            _logServiceMock.Verify(l => l.Error(It.IsAny <string>(), It.IsAny <Exception>()), Times.Never);
        }
Пример #4
0
        public void ShouldSendTraineeshipApplicationSubmittedEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = TokenGenerator.CreateTraineeshipApplicationSubmittedTokens(),
                MessageType = MessageTypes.TraineeshipApplicationSubmitted
            };

            _dispatcher.SendEmail(request);

            _logServiceMock.Verify(l => l.Error(It.IsAny <string>(), It.IsAny <Exception>()), Times.Never);
        }
Пример #5
0
        public void ShoudSendEmailWithSubjectInTemplate()
        {
            // NOTE: Subject is not set and is defined in SendGrid email template.
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = TokenGenerator.CreateActivationEmailTokens(),
                MessageType = MessageTypes.SendActivationCode
            };

            _dispatcher.SendEmail(request);

            _logServiceMock.Verify(l => l.Error(It.IsAny <string>(), It.IsAny <Exception>()), Times.Never);
        }