Exemplo n.º 1
0
        public void ParsePasswordRecoveryTemplate()
        {
            const string userName     = "******";
            const string recoveryLink = "X_RECOVERYLINK_X";

            var message = EmailFactory.ParseTemplate(new PasswordRecovery
            {
                UserName     = userName,
                RecoveryLink = recoveryLink
            }, EmailType.PasswordRecovery);

            Assert.That(message.Contains(userName));
            Assert.That(message.Contains(recoveryLink));
        }
Exemplo n.º 2
0
        public void ParseRejectionTemplate()
        {
            const string boardName      = "X_BOARDNAME_X";
            const string boardOwnerName = "X_OWNERNAME_X";
            const string loserName      = "X_LOSERNAME_X";
            const string winnerName     = "X_WINNER_NAME";

            var message = EmailFactory.ParseTemplate(new MatchRejectionNotice
            {
                BoardName      = boardName,
                BoardOwnerName = boardOwnerName,
                RejectedName   = loserName,
                RejectorName   = winnerName
            }, EmailType.MatchRejectionNotice);

            Assert.That(message.Contains(boardName));
            Assert.That(message.Contains(boardOwnerName));
            Assert.That(message.Contains(loserName));
            Assert.That(message.Contains(winnerName));
        }
Exemplo n.º 3
0
        public void ParseMatchTemplate()
        {
            const int    autoVerified  = 100;
            const string boardName     = "X_BOARDNAME_X";
            const string loserName     = "X_LOSERNAME_X";
            const string winnerComment = "X_WINNER_COMMENT_X";
            const string winnerName    = "X_WINNER_NAME_X";

            var message = EmailFactory.ParseTemplate(new MatchNotification
            {
                AutoVerifies  = autoVerified,
                BoardName     = boardName,
                LoserName     = loserName,
                WinnerComment = winnerComment,
                WinnerName    = winnerName
            }, EmailType.MatchNotification);

            Assert.That(message.Contains(autoVerified.ToString()));
            Assert.That(message.Contains(boardName));
            Assert.That(message.Contains(loserName));
            Assert.That(message.Contains(winnerComment));
            Assert.That(message.Contains(winnerName));
        }
Exemplo n.º 4
0
        public void SendEmail <T>(string emailAddress, string emailName, string subject, EmailType emailType, T model) where T : IEmailModel
        {
            var message = EmailFactory.ParseTemplate(model, emailType);

            _postmaster.Send(new EmailContact(emailAddress, emailName), subject, message);
        }