public void GetObjectiveArrayCc_returns_results_in_specified_json_format()
        {
            // Given
            var sampleCcObjectiveArrayResult = new[]
            {
                new CcObjective(1, "name1", 4),
                new CcObjective(1, "name2", 0),
            };

            A.CallTo(() => tutorialContentDataService.GetNonArchivedCcObjectivesBySectionAndCustomisationId(1, 1, true))
            .Returns(sampleCcObjectiveArrayResult);

            // When
            var result = trackerActionService.GetObjectiveArrayCc(1, 1, true);

            // Then
            result.Should().BeEquivalentTo(new TrackerObjectiveArrayCc(sampleCcObjectiveArrayResult));
        }
Exemplo n.º 2
0
        public void ProcessQuery_with_GetObjectiveArrayCc_action_passes_query_params_and_parses_IsPostLearning(
            string?isPostLearningValue,
            bool?expectedBool
            )
        {
            // Given
            var query = new TrackerEndpointQueryParams
            {
                Action = "GetObjectiveArrayCc", CustomisationId = 1, SectionId = 2, IsPostLearning = isPostLearningValue,
            };

            // When
            trackerService.ProcessQuery(query);

            // Then
            A.CallTo(() => actionService.GetObjectiveArrayCc(1, 2, expectedBool))
            .MustHaveHappenedOnceExactly();
        }