public async Task CourseGet()
        {
            var courseGetRequest = new CourseGetRequest
            {
                CourseId = Guid.Parse("2ed8b2f9-da49-4432-963b-5842746aef5c"),
                RunId    = Guid.Parse("f6f0036f-5cdf-486c-8b3e-1bb102940cd1"),
            };
            var courseSearchService = new CourseSearchApiService(findACourseClient, auditService, mapper);
            var detailResponse      = await courseSearchService.GetCourseDetailsAsync(courseGetRequest.CourseId.ToString(), courseGetRequest.RunId.ToString()).ConfigureAwait(false);

            detailResponse.CourseId.Should().Be(courseGetRequest.CourseId.ToString());
        }
Esempio n. 2
0
        public async Task GetCourseDetailsAsyncReturnsGroupedCourseList()
        {
            // Arrange
            var dummyApiResponse  = BuildCourseRunDetailResponse();
            var findACourseClient = A.Fake <IFindACourseClient>();

            A.CallTo(() => findACourseClient.CourseGetAsync(A <CourseGetRequest> .Ignored)).Returns(dummyApiResponse);

            var courseSearchService = new CourseSearchApiService(findACourseClient, defaultAuditService, defaultMapper);

            // Act
            var result = await courseSearchService.GetCourseDetailsAsync(courseId.ToString(), courseRunId.ToString()).ConfigureAwait(false);

            // Assert
            Assert.Equal(courseId.ToString(), result.CourseId);
        }