public void GetProgressCompletionData_returns_data_correctly()
        {
            // Given
            using var transaction = new TransactionScope();

            const int    customisationId         = 236;
            const string courseNotificationEmail = "*****@*****.**";

            connection.Execute(
                @"UPDATE Customisations
                        SET NotificationEmails = @courseNotificationEmail
                        WHERE CustomisationID = @customisationId",
                new { customisationId, courseNotificationEmail }
                );

            var progressCompletionData = new ProgressCompletionData
            {
                CentreId   = 237,
                CourseName = "Entry Level - Win XP, Office 2003/07 OLD - Standard",
                AdminEmail = null,
                CourseNotificationEmail = courseNotificationEmail,
                SessionId = 429,
            };

            // When
            var result = notificationDataService.GetProgressCompletionData(100, 103, customisationId);

            // Then
            result.Should().BeEquivalentTo(progressCompletionData);
        }
        public void GetProgressCompletionData_returns_admin_email_when_there_is_one()
        {
            // Given
            var progressCompletionData = new ProgressCompletionData
            {
                CentreId   = 374,
                CourseName = "Level 3 - Microsoft Word 2010  - LH TEST NEW COURSE PUBLISHED",
                AdminEmail = "hcoayru@lmgein.",
                CourseNotificationEmail = null,
                SessionId = 0,
            };

            // When
            var result = notificationDataService.GetProgressCompletionData(276626, 293518, 27312);

            // Then
            result.Should().BeEquivalentTo(progressCompletionData);
        }
        private void SetUpSendProgressCompletionNotificationEmailFakes(
            int centreId      = 101,
            string courseName = "Example application - course name",
            string?adminEmail = null,
            int sessionId     = 123
            )
        {
            var progressCompletionData = new ProgressCompletionData
            {
                CentreId   = centreId,
                CourseName = courseName,
                AdminEmail = adminEmail,
                SessionId  = sessionId,
            };

            A.CallTo(() => notificationDataService.GetProgressCompletionData(ProgressId, DelegateId, CustomisationId))
            .Returns(progressCompletionData);
            A.CallTo(() => emailService.SendEmail(A <Email> ._))
            .DoesNothing();
        }