public DiagnosticContent?GetDiagnosticContent(int customisationId, int sectionId, List <int> checkedTutorials)
        {
            var diagnosticContent = diagnosticAssessmentDataService.GetDiagnosticContent(customisationId, sectionId);

            if (diagnosticContent == null)
            {
                return(null);
            }

            if (!diagnosticContent.CanSelectTutorials)
            {
                return(diagnosticContent);
            }

            if (checkedTutorials.Except(diagnosticContent.Tutorials).Any())
            {
                logger.LogError(
                    "No diagnostic content returned as checked tutorials do not match diagnostic content tutorials. " +
                    $"Customisation id: {customisationId}, section id: {sectionId}, " +
                    $"checked tutorials: [{string.Join(",", checkedTutorials)} " +
                    $"diagnostic content tutorials: [{string.Join(",", diagnosticContent)}");
                return(null);
            }

            return(diagnosticContent);
        }
        public void Get_diagnostic_content_should_return_null_when_data_service_returns_null()
        {
            // Given
            var emptySelectedTutorials = new List <int>();

            A.CallTo(() => diagnosticAssessmentDataService.GetDiagnosticContent(CustomisationId, SectionId))
            .Returns(null);

            // When
            var result = diagnosticAssessmentService.GetDiagnosticContent(CustomisationId, SectionId, emptySelectedTutorials);

            // Then
            result.Should().BeNull();
        }