Esempio n. 1
0
        public void ShouldNotSendContactMessageEmailWithBlankEnquiryDetails()
        {
            var request = new EmailRequest
            {
                ToEmail     = TestToEmail,
                Tokens      = CandidateEmailTokenGenerator.CreateContactUsMessageTokensWithDetails(string.Empty),
                MessageType = MessageTypes.CandidateContactUsMessage
            };

            _dispatcher.SendEmail(request);
            VerifyErrorsLogged(Times.Never());
        }
Esempio n. 2
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());
        }