public async Task Then_The_Api_Is_Called_To_Update_the_vendor_registration_case_status(
            UpdateVendorRegistrationCaseStatusRequest request,
            [Frozen] Mock <IEmployerIncentivesApiClient <EmployerIncentivesConfiguration> > client,
            VendorRegistrationService service)
        {
            await service.UpdateVendorRegistrationCaseStatus(request);

            client.Verify(x =>
                          x.Patch(It.Is <PatchVendorRegistrationCaseStatusRequest>(
                                      c =>
                                      c.PatchUrl.Contains(request.HashedLegalEntityId) && c.Data.IsSameOrEqualTo(request)
                                      )), Times.Once
                          );
        }
示例#2
0
        public async Task Then_The_InnerApi_Is_Called(
            string hashedLegalEntityId,
            string employerVendorId,
            [Frozen] Mock <IEmployerIncentivesApiClient <EmployerIncentivesConfiguration> > client,
            VendorRegistrationService sut)
        {
            await sut.AddEmployerVendorIdToLegalEntity(hashedLegalEntityId, employerVendorId);

            client.Verify(x =>
                          x.Put(It.Is <PutEmployerVendorIdForLegalEntityRequest>(
                                    c => ((PutEmployerVendorIdForLegalEntityRequestData)c.Data).EmployerVendorId == employerVendorId &&
                                    c.PutUrl.Contains(hashedLegalEntityId))
                                ), Times.Once);
        }
示例#3
0
        public async Task Then_The_IncentivesApi_Is_Called_Returning_The_Response(
            GetLatestVendorRegistrationCaseUpdateDateTimeResponse apiResponse,
            [Frozen] Mock <IEmployerIncentivesApiClient <EmployerIncentivesConfiguration> > client,
            VendorRegistrationService service
            )
        {
            client.Setup(x =>
                         x.Get <GetLatestVendorRegistrationCaseUpdateDateTimeResponse>(
                             It.IsAny <GetLatestVendorRegistrationCaseUpdateDateTimeRequest>()))
            .ReturnsAsync(apiResponse);

            var actual = await service.GetLatestVendorRegistrationCaseUpdateDateTime();

            actual.Should().BeEquivalentTo(apiResponse);
        }