Esempio n. 1
0
        public void Setup()
        {
            _baseAddress = new Uri("http://localhost");
            _testClient  = new TestHttpClient(_baseAddress);
            _testClient.SetUpPatchAsAsync(HttpStatusCode.OK);

            _sut = new CollectionCalendarService(_testClient);

            _fixture = new Fixture();
        }
        public async Task Then_The_InnerApi_Is_Called(
            UpdateCollectionCalendarPeriodRequestData request,
            [Frozen] Mock <IEmployerIncentivesApiClient <EmployerIncentivesConfiguration> > client,
            CollectionCalendarService sut)
        {
            await sut.UpdateCollectionCalendarPeriod(request);

            client.Verify(x =>
                          x.Patch <UpdateCollectionCalendarPeriodRequestData>(It.Is <UpdateCollectionCalendarPeriodRequest>(
                                                                                  c => ((UpdateCollectionCalendarPeriodRequestData)c.Data).PeriodNumber == request.PeriodNumber &&
                                                                                  ((UpdateCollectionCalendarPeriodRequestData)c.Data).AcademicYear == request.AcademicYear &&
                                                                                  ((UpdateCollectionCalendarPeriodRequestData)c.Data).Active == request.Active &&
                                                                                  c.PatchUrl.Equals("collectionPeriods"))
                                                                              ), Times.Once);
        }