Exemplo n.º 1
0
        private CandidateAvailableConfirmationEmail CreateCandidateAvailableConfirmationEmail(string emailAddress)
        {
            var email = new CandidateAvailableConfirmationEmail(_memberUser);

            _memberUser.EmailAddresses = new List <EmailAddress> {
                new EmailAddress {
                    Address = emailAddress
                }
            };
            email.To = _memberUser;
            return(email);
        }
        public void TestEmailContents()
        {
            // Create a member.

            var member = CreateMember();

            // Send the email.

            var templateEmail = new CandidateAvailableConfirmationEmail(member);

            _emailsCommand.TrySend(templateEmail);

            // Check.

            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(Return, Return, member);
            email.AssertSubject(Subject);
            email.AssertHtmlViewChecks();
            email.AssertHtmlView(GetBody(templateEmail, member, GetContent(templateEmail, member)));
            AssertCompatibleAddresses(email);
        }