Пример #1
0
        public void TestOnlineSales()
        {
            var stats = _dailyReportsQuery.GetDailyReport(DayRange.Yesterday);

            stats.OrderReports = new List <OrderReport>
            {
                new OrderReport
                {
                    ClientName       = "Test Client",
                    OrganisationName = "Test Organisation",
                    Products         = new[] { "5 Contacts", "10 Applicants" },
                    Price            = 400
                }
            };

            var templateEmail = new StatsEmail(stats);

            _emailsCommand.TrySend(templateEmail);

            // Check.

            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(System, Return, AllStaff);
            email.AssertSubject(Subject);
            email.AssertHtmlViewChecks();

            email.AssertHtmlViewContains("<td>Test Client</td>");
            email.AssertHtmlViewContains("<td>Test Organisation</td>");
            email.AssertHtmlViewContains("<td>5 Contacts, 10 Applicants</td>");
            email.AssertHtmlViewContains("<td>$400.00</td>");

            email.AssertNoAttachments();
            AssertCompatibleAddresses(email);
        }
Пример #2
0
        public void TestCommunications()
        {
            var stats = _dailyReportsQuery.GetDailyReport(DayRange.Yesterday);

            // Add some templateEmail stats.

            stats.CommunciationReports = new Dictionary <string, CommunicationReport>
            {
                { "FriendInvitationEmail", new CommunicationReport {
                      Sent = 12, Opened = 4, LinksClicked = 8
                  } }
            };
            var templateEmail = new StatsEmail(stats);

            _emailsCommand.TrySend(templateEmail);

            // Check.

            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(System, Return, AllStaff);
            email.AssertSubject(Subject);
            email.AssertHtmlViewChecks();
            //email.AssertHtmlView(GetBody(templateEmail, GetContent()));
            email.AssertNoAttachments();
            AssertCompatibleAddresses(email);
        }
Пример #3
0
        public void TestEmailContents()
        {
            // Create users.

            const int interval = -1;

            CreateMember(1, false);
            CreateMember(2, false);
            CreateMember(3, false, DateTime.Now.AddDays(interval - 1));

            CreateEmployer(4);
            CreateEmployer(5);
            CreateEmployer(6, DateTime.Now.AddDays(interval - 1));

            CreateRecruiter(7);
            CreateRecruiter(8);
            CreateRecruiter(9, DateTime.Now.AddDays(interval - 1));

            // Send.

            var dailyReport   = _dailyReportsQuery.GetDailyReport(DayRange.Yesterday);
            var templateEmail = new StatsEmail(dailyReport);

            _emailsCommand.TrySend(templateEmail);

            // Check.

            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(System, Return, AllStaff);
            email.AssertSubject(Subject);
            email.AssertHtmlViewChecks();
            email.AssertHtmlView(GetBody(templateEmail, GetContent(dailyReport)));
            email.AssertNoAttachments();
            AssertCompatibleAddresses(email);
        }