Beispiel #1
0
        public async Task FirstEmployerFeedbackDataRefresh()
        {
            // Assert
            await CleanupData();

            var expectedInvites = new List <EmployerSurveyInvite>
            {
                new EmployerSurveyInvite {
                    UserRef = _user1Guid, EmailAddress = "*****@*****.**", FirstName = "Master", AccountId = 1, Ukprn = 1, ProviderName = "Test Academy"
                },
                new EmployerSurveyInvite {
                    UserRef = _user1Guid, EmailAddress = "*****@*****.**", FirstName = "Master", AccountId = 1, Ukprn = 2, ProviderName = "Worst School"
                },
                new EmployerSurveyInvite {
                    UserRef = _user2Guid, EmailAddress = "*****@*****.**", FirstName = "Flash", AccountId = 1, Ukprn = 1, ProviderName = "Test Academy"
                },
                new EmployerSurveyInvite {
                    UserRef = _user2Guid, EmailAddress = "*****@*****.**", FirstName = "Flash", AccountId = 1, Ukprn = 2, ProviderName = "Worst School"
                },
            };

            // Act
            await RunThroughRefreshFunctions();

            // Assert
            var invites = await _dbEmployerFeedbackRepository.GetEmployerUsersToBeSentInvite();

            invites.Count().Should().Be(4);
            invites.Should().BeEquivalentTo(expectedInvites, options => options.Excluding(
                                                s => s.SelectedMemberPath.EndsWith(".UniqueSurveyCode")));
        }
Beispiel #2
0
        public async Task SendEmailsAsync()
        {
            var emailsToSend = await _emailDetailsStore.GetEmployerUsersToBeSentInvite();

            var emailsGroupByUser = GroupEmailsToSendByUser(emailsToSend);

            await SendGroupedEmails(emailsGroupByUser);
        }