Example #1
0
        public static void Subject_contains_request_date(int month, int day, string expectedSubject)
        {
            var template = new SingleDayAllocationNotification(
                new Request("user1", new LocalDate(2020, month, day), RequestStatus.Allocated),
                CreateUser.With(userId: "user1", emailAddress: "*****@*****.**"));

            Assert.Equal(expectedSubject, template.Subject);
        }
Example #2
0
        public static void To_returns_email_address_of_corresponding_user(string emailAddress)
        {
            var template = new SingleDayAllocationNotification(
                new Request("user1", 2.January(2021), RequestStatus.Allocated),
                CreateUser.With(userId: "user1", emailAddress: emailAddress));

            Assert.Equal(emailAddress, template.To);
        }
Example #3
0
        public static void Body_contains_request_date(int month, int day, string expectedDateText)
        {
            var template = new SingleDayAllocationNotification(
                new Request("user1", new LocalDate(2020, month, day), RequestStatus.Allocated),
                CreateUser.With(userId: "user1", emailAddress: "*****@*****.**"));

            var expectedPlainTextBody =
                $"You have been allocated a parking space for {expectedDateText}.\r\n\r\n" +
                "If you no longer need this space, please cancel your request so that it can be given to someone else.";
            var expectedHtmlBody =
                $"<p>You have been allocated a parking space for {expectedDateText}.</p>\r\n" +
                "<p>If you no longer need this space, please cancel your request so that it can be given to someone else.</p>";

            Assert.Equal(expectedPlainTextBody, template.PlainTextBody);
            Assert.Equal(expectedHtmlBody, template.HtmlBody);
        }