Ejemplo n.º 1
0
        public void Get_tutorial_information_next_section_id_has_correct_ids_when_shared_section_number(
            int sectionId,
            int tutorialId,
            int expectedNextSectionId
            )
        {
            using (new TransactionScope())
            {
                // Given
                const int customisationId = 24057;
                const int candidateId     = 1;
                sectionContentTestHelper.UpdateSectionNumber(2195, 10);
                // Doing this should result in the following sequence:
                // SectionID: 2087, SectionNumber: 6
                // SectionID: 2195, SectionNumber: 10
                // SectionID: 2199, SectionNumber: 10
                // SectionID: 2086, SectionNumber: 11

                // When
                var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

                // Then
                tutorial.Should().NotBeNull();
                tutorial !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }
Ejemplo n.º 2
0
        public void Get_tutorial_information_nextSection_skips_section_with_just_diagnostic_assessment_but_no_path()
        {
            using (new TransactionScope())
            {
                // Given
                const int candidateId     = 74411;
                const int customisationId = 5852;
                const int sectionId       = 148;
                const int tutorialId      = 628;

                const int originalNextSectionId = 149; // All tutorials are CustomisationTutorials.Status = 0, though some DiagStatus = 1
                // Remove diagnostic and post learning paths
                sectionContentTestHelper.UpdateDiagnosticAssessmentPath(originalNextSectionId, null);
                sectionContentTestHelper.UpdatePostLearningAssessmentPath(originalNextSectionId, null);

                const int expectedNextSectionId = 150;

                // When
                var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

                // Then
                tutorial.Should().NotBeNull();
                tutorial !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }
Ejemplo n.º 3
0
        public void Get_diagnostic_assessment_should_return_null_nextSection_if_last_section_in_course()
        {
            // Given
            const int candidateId     = 1;
            const int customisationId = 1379;
            const int sectionId       = 82;

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().BeNull();
        }
Ejemplo n.º 4
0
        public void Get_tutorial_information_should_return_null_nextSection_if_last_section_in_course()
        {
            // Given
            const int candidateId     = 1;
            const int customisationId = 1379;
            const int sectionId       = 82;
            const int tutorialId      = 94;

            // When
            var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

            // Then
            tutorial.Should().NotBeNull();
            tutorial !.NextSectionId.Should().BeNull();
        }
Ejemplo n.º 5
0
        public void Get_diagnostic_assessment_nextSection_returns_section_with_only_post_learning_assessment()
        {
            // Given
            const int customisationId       = 10820;
            const int candidateId           = 1;
            const int sectionId             = 104;
            const int expectedNextSectionId = 105; // All tutorials are CustomisationTutorials.Status and DiagStatus = 0
                                                   // Customisations.IsAssessed = 1 and Sections.PLAssessPath is not null
                                                   // When
            var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().Be(expectedNextSectionId);
        }
Ejemplo n.º 6
0
        public void Get_diagnostic_assessment_nextSection_skips_archived_sections()
        {
            // Given
            const int candidateId     = 118178;
            const int customisationId = 22416;
            const int sectionId       = 1958;

            const int nextSectionId = 1960; // Skips archived section 1959

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 7
0
        public void Get_diagnostic_assessment_nextSection_returns_section_with_only_diagnostic_assessment()
        {
            // Given
            const int candidateId     = 74411;
            const int customisationId = 5852;
            const int sectionId       = 150;

            const int expectedNextSectionId = 151; // All tutorials are CustomisationTutorials.Status = 0, though some DiagStatus = 1

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().Be(expectedNextSectionId);
        }
Ejemplo n.º 8
0
        public void Get_post_learning_assessment_next_section_id_skips_archived_sections()
        {
            // Given
            const int candidateId     = 118178;
            const int customisationId = 22416;
            const int sectionId       = 1958;

            const int nextSectionId = 1960; // Skips archived section 1959

            // When
            var result = postLearningAssessmentService.GetPostLearningAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 9
0
        public void Get_diagnostic_assessment_nextSection_can_return_smaller_sectionId()
        {
            // Given
            const int candidateId     = 210962;
            const int customisationId = 17668;
            const int sectionId       = 747;

            const int nextSectionId = 746;

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 10
0
        public void Get_tutorial_information_nextSection_can_return_smaller_sectionId()
        {
            // Given
            const int candidateId     = 210962;
            const int customisationId = 24057;
            const int sectionId       = 2201;
            const int tutorialId      = 10184;

            const int nextSectionId = 2193;

            // When
            var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

            // Then
            tutorial.Should().NotBeNull();
            tutorial !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 11
0
        public void Get_tutorial_information_nextSection_skips_archived_sections()
        {
            // Given
            const int candidateId     = 118178;
            const int customisationId = 22416;
            const int sectionId       = 1958;
            const int tutorialId      = 9349;

            const int nextSectionId = 1960; // Skips archived section 1959

            // When
            var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

            // Then
            tutorial.Should().NotBeNull();
            tutorial !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 12
0
        public void Get_tutorial_information_nextSection_returns_section_with_only_post_learning_assessment()
        {
            // Given
            const int customisationId = 10820;
            const int candidateId     = 1;
            const int sectionId       = 104;
            const int tutorialId      = 331;

            const int expectedNextSectionId = 105; // All tutorials are CustomisationTutorials.Status and DiagStatus = 0
                                                   // Customisations.IsAssessed = 1 and Sections.PLAssessPath is not null
                                                   // When
            var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

            // Then
            tutorial.Should().NotBeNull();
            tutorial !.NextSectionId.Should().Be(expectedNextSectionId);
        }
Ejemplo n.º 13
0
        public void Get_diagnostic_assessment_nextSection_should_skip_empty_sections()
        {
            // Given
            const int candidateId     = 210934;
            const int customisationId = 18366;
            const int sectionId       = 974;

            // The next section ID in this Application is 975, but the next section with a tutorial selected in
            // CustomisationTutorials is 978
            const int nextSectionId = 978;

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

            // Then
            result.Should().NotBeNull();
            result !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 14
0
        public void Get_tutorial_information_nextSection_should_skip_empty_sections()
        {
            // Given
            const int candidateId     = 210934;
            const int customisationId = 18366;
            const int sectionId       = 974;
            const int tutorialId      = 4262;

            // The next section ID in this Application is 975, but the next section with a tutorial selected in
            // CustomisationTutorials is 978
            const int nextSectionId = 978;

            // When
            var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

            // Then
            tutorial.Should().NotBeNull();
            tutorial !.NextSectionId.Should().Be(nextSectionId);
        }
Ejemplo n.º 15
0
        public void Get_diagnostic_assessment_nextSection_skips_sections_full_of_archived_tutorials()
        {
            using (new TransactionScope())
            {
                // Given
                const int candidateId     = 210962;
                const int customisationId = 15062;
                const int sectionId       = 246;

                // The tutorials of what would be the next section, 247;
                tutorialContentTestHelper.ArchiveTutorial(1136);

                const int expectedNextSectionId = 248;

                // When
                var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

                // Then
                result.Should().NotBeNull();
                result !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }
Ejemplo n.º 16
0
        public void Get_diagnostic_assessment_nextSection_skips_assessed_section_with_no_assessment_path()
        {
            using (new TransactionScope())
            {
                // Given
                const int customisationId = 10820;
                const int candidateId     = 1;
                const int sectionId       = 104;

                const int originalNextSectionId = 105; // All tutorials are CustomisationTutorials.Status and DiagStatus = 0
                                                       // Customisations.IsAssessed = 1
                sectionContentTestHelper.UpdatePostLearningAssessmentPath(originalNextSectionId, null);
                const int expectedNextSectionId = 106;

                // When
                var result = diagnosticAssessmentDataService.GetDiagnosticAssessment(customisationId, candidateId, sectionId);

                // Then
                result.Should().NotBeNull();
                result !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }
Ejemplo n.º 17
0
        public void Get_tutorial_information_nextSection_returns_section_with_only_diagnostic_assessment()
        {
            using (new TransactionScope())
            {
                // Given
                const int candidateId     = 74411;
                const int customisationId = 5852;
                const int sectionId       = 150;
                const int tutorialId      = 634;

                const int expectedNextSectionId = 151; // All tutorials are CustomisationTutorials.Status = 0, though some DiagStatus = 1
                // Remove post learning assessment
                sectionContentTestHelper.UpdatePostLearningAssessmentPath(expectedNextSectionId, null);

                // When
                var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

                // Then
                tutorial.Should().NotBeNull();
                tutorial !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }
Ejemplo n.º 18
0
        public void Get_post_learning_assessment_next_section_skips_sections_full_of_archived_tutorials()
        {
            using (new TransactionScope())
            {
                // Given
                const int candidateId     = 210962;
                const int customisationId = 24057;
                const int sectionId       = 2201;

                // The tutorials of what would be the next section, 2193;
                tutorialContentTestHelper.ArchiveTutorial(10161);
                tutorialContentTestHelper.ArchiveTutorial(10195);
                postLearningAssessmentTestHelper.EnablePostLearning(customisationId, sectionId);

                const int expectedNextSectionId = 2088;

                // When
                var result = postLearningAssessmentService.GetPostLearningAssessment(customisationId, candidateId, sectionId);

                // Then
                result.Should().NotBeNull();
                result !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }
Ejemplo n.º 19
0
        public void Get_tutorial_information_nextSection_skips_sections_full_of_archived_tutorials()
        {
            using (new TransactionScope())
            {
                // Given
                const int candidateId     = 210962;
                const int customisationId = 24057;
                const int sectionId       = 2201;
                const int tutorialId      = 10184;

                // The tutorials of what would be the next section, 2193;
                tutorialContentTestHelper.ArchiveTutorial(10161);
                tutorialContentTestHelper.ArchiveTutorial(10195);

                const int expectedNextSectionId = 2088;

                // When
                var tutorial = tutorialContentDataService.GetTutorialInformation(candidateId, customisationId, sectionId, tutorialId);

                // Then
                tutorial.Should().NotBeNull();
                tutorial !.NextSectionId.Should().Be(expectedNextSectionId);
            }
        }