Ejemplo n.º 1
0
        public void ShouldSendFeedbackMessageEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateFeedbackTokens(),
                MessageType = MessageTypes.CandidateFeedbackMessage
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 2
0
        public void ShouldSendAccountUnlockCodeEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateAccountUnlockCodeTokens(),
                MessageType = MessageTypes.SendAccountUnlockCode
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 3
0
        public void ShouldSendSavedSearchAlertsEmailWithSubCategories()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateSavedSearchAlertTokens(5, true),
                MessageType = MessageTypes.SavedSearchAlert
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 4
0
        public void ShouldNotSendContactMessageEmailWithBlankEnquiryDetails()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateContactUsMessageTokensWithDetails(string.Empty),
                MessageType = MessageTypes.CandidateContactUsMessage
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 5
0
        public void ShouldSendDailyDigestEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateDailyDigestTokens(4),
                MessageType = MessageTypes.DailyDigest
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 6
0
        public void ShouldSendPasswordResetConfirmationEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreatePasswordResetConfirmationTokens(),
                MessageType = MessageTypes.PasswordChanged
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 7
0
        public void ShouldSendTraineeshipApplicationSubmittedEmail()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateTraineeshipApplicationSubmittedTokens(),
                MessageType = MessageTypes.TraineeshipApplicationSubmitted
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 8
0
        public void ShoudSendEmailWithSubjectInTemplate()
        {
            // NOTE: Subject is not set and is defined in SendGrid email template.
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateActivationEmailTokens(),
                MessageType = MessageTypes.SendActivationCode
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Ejemplo n.º 9
0
        public void ShouldNotSendContactMessageEmailWithNullEnquiryDetails()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateContactUsMessageTokensWithDetails(null),
                MessageType = MessageTypes.CandidateContactUsMessage
            };

            Action sendEmail = () => _dispatcher.SendEmail(request);

            sendEmail.ShouldThrow <CustomException>().Which.Code.Should().Be(ErrorCodes.EmailError);
            VerifyErrorsLogged(Times.Once());
        }