Example #1
0
        public void GetCoursesAndCourseDelegatesForCentre_populates_course_delegates_data()
        {
            // Given
            const int centreId   = 2;
            const int categoryId = 1;

            A.CallTo(() => courseDataService.GetCoursesAvailableToCentreByCategory(centreId, categoryId))
            .Returns(new List <CourseAssessmentDetails> {
                new CourseAssessmentDetails {
                    CustomisationId = 1
                }
            });
            A.CallTo(() => courseDelegatesDataService.GetDelegatesOnCourse(A <int> ._, A <int> ._))
            .Returns(new List <CourseDelegate> {
                new CourseDelegate()
            });

            // When
            var result = courseDelegatesService.GetCoursesAndCourseDelegatesForCentre(
                centreId,
                categoryId,
                null
                );

            // Then
            using (new AssertionScope())
            {
                result.Courses.Should().HaveCount(1);
                result.Delegates.Should().HaveCount(1);
                result.CustomisationId.Should().Be(1);
            }
        }
Example #2
0
        public void GetDelegatesOnCourse_returns_expected_values()
        {
            // Given
            var expectedFirstRecord = new CourseDelegate
            {
                Active          = true,
                CandidateNumber = "PC97",
                CompleteByDate  = null,
                DelegateId      = 32926,
                EmailAddress    = "erpock.hs@5bntu",
                Enrolled        = new DateTime(2012, 07, 02, 13, 30, 37, 807),
                FirstName       = "xxxxx",
                LastName        = "xxxx",
                LastUpdated     = new DateTime(2012, 07, 31, 10, 18, 39, 993),
                Locked          = false,
                ProgressId      = 18395,
                RemovedDate     = null,
                Completed       = null,
                AllAttempts     = 0,
                AttemptsPassed  = 0
            };

            // When
            var result = courseDelegatesDataService.GetDelegatesOnCourse(1, 2).ToList();

            // Then
            using (new AssertionScope())
            {
                result.Should().HaveCount(3);
                result.First().Should().BeEquivalentTo(expectedFirstRecord);
            }
        }
Example #3
0
 public IEnumerable <CourseDelegate> GetCourseDelegatesForCentre(int customisationId, int centreId)
 {
     return(courseDelegatesDataService.GetDelegatesOnCourse(customisationId, centreId));
 }