Exemple #1
0
        public async Task Then_Returns_The_Apprenticeships(
            long accountId,
            long accountLegalEntityId,
            DateTime startDateFrom,
            DateTime startDateTo,
            GetApprenticeshipListResponse response,
            [Frozen] Mock <ICommitmentsApiClient <CommitmentsConfiguration> > client,
            [Greedy] CommitmentsService sut)
        {
            client.Setup(x => x.Get <GetApprenticeshipListResponse>(It.Is <IGetApiRequest>(p =>
                                                                                           p.GetUrl == $"api/apprenticeships?accountId={accountId}&accountLegalEntityId={accountLegalEntityId}&startDateRangeFrom={WebUtility.UrlEncode(startDateFrom.ToString("u"))}&startDateRangeTo={WebUtility.UrlEncode(startDateTo.ToString("u"))}")))
            .ReturnsAsync(response);

            var result = await sut.Apprenticeships(accountId, accountLegalEntityId, startDateFrom, startDateTo);

            result.Should().BeEquivalentTo(response.Apprenticeships);
        }