예제 #1
0
        public void Get_diagnostic_assessment_should_get_tutorialIds_ordered_by_orderBy_then_tutorialId()
        {
            using (new TransactionScope())
            {
                // Given
                const int candidateId     = 1;
                const int customisationId = 8194;
                const int sectionId       = 216;

                tutorialContentTestHelper.UpdateDiagAssessOutOf(928, 1);

                // ...
                // Tutorial: 927  OrderByNumber 34
                // Tutorial: 928  OrderByNumber 35
                // Tutorial: 929  OrderByNumber 35
                // ...

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

                // Then
                result.Should().NotBeNull();
                var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();
                tutorialIds.Should()
                .Equal(923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940);
            }
        }
예제 #2
0
        public void Get_diagnostic_assessment_can_have_tutorials_with_false_status()
        {
            // Given
            const int customisationId = 5694;
            const int candidateId     = 1;
            const int sectionId       = 103;

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

            // Then
            result.Should().NotBeNull();
            var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();

            tutorialIds.Should().Equal(319, 320, 322, 323, 321, 324); // All have CustomisationTutorials.Status = 0
        }
예제 #3
0
        public void Get_diagnostic_assessment_should_use_nonzero_originalTutorialIds()
        {
            // Given
            const int customisationId = 26178;
            const int candidateId     = 285914;
            const int sectionId       = 2479;

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

            // Then
            result.Should().NotBeNull();
            var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();

            // Tutorial ID 11376 was not replaced, but the other four have been
            tutorialIds.Should().Equal(11376, 1576, 1577, 1578, 1579);
        }
예제 #4
0
        public void Get_diagnostic_assessment_should_not_have_tutorials_with_diagAssessOutOf_less_than_1()
        {
            // Given
            const int customisationId = 21058;
            const int candidateId     = 172968;
            const int sectionId       = 189;

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

            // Then
            result.Should().NotBeNull();
            var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();

            tutorialIds.Should().NotContain(806); // Tutorial with DiagAssessOutOf = 0
            tutorialIds.Should().Equal(804, 805, 807);
        }
예제 #5
0
        public void Get_diagnostic_assessment_should_not_have_archived_tutorials()
        {
            // Given
            const int customisationId = 22416;
            const int candidateId     = 118178;
            const int sectionId       = 1955;

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

            // Then
            result.Should().NotBeNull();
            var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();

            tutorialIds.Should().NotContain(9366); // Archived tutorial
            tutorialIds.Should().Equal(9332, 9333);
        }
예제 #6
0
        public void Get_diagnostic_assessment_should_not_have_tutorials_with_false_diagStatus()
        {
            // Given
            const int customisationId = 14579;
            const int candidateId     = 102375;
            const int sectionId       = 135;

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

            // Then
            result.Should().NotBeNull();
            var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();

            tutorialIds.Should().NotContain(541); // Tutorial with DiagStatus 0
            tutorialIds.Should().Equal(535, 536, 537, 538, 539, 540, 542);
        }
예제 #7
0
        public void Get_diagnostic_assessment_should_get_tutorialIds_ordered_by_orderBy()
        {
            // Given
            const int candidateId     = 210934;
            const int customisationId = 17731;
            const int sectionId       = 801;

            // Tutorial: 3330  OrderByNumber 1
            // Tutorial: 3331  OrderByNumber 2
            // Tutorial: 3332  OrderByNumber 3
            // Tutorial: 3333  OrderByNumber 5
            // Tutorial: 3334  OrderByNumber 4

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

            // Then
            result.Should().NotBeNull();
            var tutorialIds = result !.Tutorials.Select(tutorial => tutorial.Id).ToList();

            tutorialIds.Should().Equal(3330, 3331, 3332, 3334, 3333);
        }