Exemple #1
0
        public CourseAdminFields GetCustomPromptsForCourse(
            int customisationId
            )
        {
            var result = courseAdminFieldsDataService.GetCourseAdminFields(customisationId);

            return(new CourseAdminFields(
                       customisationId,
                       PopulateCustomPromptListFromCourseCustomPromptsResult(result)
                       ));
        }
Exemple #2
0
        public void GetCourseAdminFields_returns_populated_CourseAdminFieldsResult()
        {
            // Given
            var expectedCourseAdminFieldsResult =
                CustomPromptsTestHelper.GetDefaultCourseAdminFieldsResult(
                    "System Access Granted",
                    "Test",
                    "Priority Access",
                    null,
                    null,
                    null,
                    2
                    );

            // When
            var returnedCourseAdminFieldsResult = courseAdminFieldsDataService.GetCourseAdminFields(100);

            // Then
            returnedCourseAdminFieldsResult.Should().BeEquivalentTo(expectedCourseAdminFieldsResult);
        }
Exemple #3
0
        public void GetCustomPromptsForCourse_Returns_Populated_CourseAdminFields()
        {
            // Given
            var expectedPrompt1 =
                CustomPromptsTestHelper.GetDefaultCustomPrompt(1, "System Access Granted", "Test");
            var expectedPrompt2 = CustomPromptsTestHelper.GetDefaultCustomPrompt(2, "Priority Access");
            var customPrompts   = new List <CustomPrompt> {
                expectedPrompt1, expectedPrompt2
            };
            var expectedCourseAdminFields = CustomPromptsTestHelper.GetDefaultCourseAdminFields(customPrompts);

            A.CallTo(() => courseAdminFieldsDataService.GetCourseAdminFields(100))
            .Returns(CustomPromptsTestHelper.GetDefaultCourseAdminFieldsResult());

            // When
            var result = courseAdminFieldsService.GetCustomPromptsForCourse(100);

            // Then
            result.Should().BeEquivalentTo(expectedCourseAdminFields);
        }