示例#1
0
            public async Task <DetailsViewModelMapperFixture> Map()
            {
                var apiClient = new Mock <ICommitmentsApiClient>();

                apiClient.Setup(x => x.GetApprenticeship(It.IsAny <long>(), It.IsAny <CancellationToken>()))
                .ReturnsAsync(ApiResponse);

                apiClient.Setup(x => x.GetPriceEpisodes(It.IsAny <long>(), It.IsAny <CancellationToken>()))
                .ReturnsAsync(PriceEpisodesApiResponse);

                apiClient.Setup(x => x.GetApprenticeshipUpdates(It.IsAny <long>(), It.IsAny <GetApprenticeshipUpdatesRequest>(), It.IsAny <CancellationToken>()))
                .ReturnsAsync(() => GetApprenticeshipUpdatesResponse);

                apiClient.Setup(x => x.GetApprenticeshipDatalocksStatus(It.IsAny <long>(), It.IsAny <CancellationToken>()))
                .ReturnsAsync(GetDataLocksResponse);

                apiClient.Setup(x => x.GetChangeOfPartyRequests(It.IsAny <long>(), It.IsAny <CancellationToken>()))
                .ReturnsAsync(GetChangeOfPartyRequestsResponse);

                _sut = new DetailsViewModelMapper(apiClient.Object, _encodingService.Object, _featureToggleService.Object, Mock.Of <ILogger <DetailsViewModelMapper> >());

                Result = await _sut.Map(Source);

                return(this);
            }
 public Task <DetailsViewModel> Map()
 {
     return(Mapper.Map(TestHelper.Clone(Source)));
 }