public async Task When_Get_Referral_Information_Async_Is_Executed_Then_Partners_Integration_Client_Is_Called()
        {
            _partnersIntegrationClientMock.Setup(x =>
                                                 x.ReferralsApi.ReferralInformation(It
                                                                                    .IsAny <PartnersIntegration.Client.Models.ReferralInformationRequestModel>()));

            await _referralService.GetReferralInformationAsync(
                It.IsAny <Domain.Models.Referral.ReferralInformationRequestModel>());

            _partnersIntegrationClientMock.Verify(
                x => x.ReferralsApi.ReferralInformation(
                    It.IsAny <PartnersIntegration.Client.Models.ReferralInformationRequestModel>()), Times.Once);
        }
Beispiel #2
0
        public async Task <ReferralInformationResponseModel> GetReferralInformationAsync(
            [FromQuery] ReferralInformationRequestModel model)
        {
            model.SetPartnerId(_requestContext.UserId);

            var sanitizedModel = new { model.CustomerId, model.LocationId, PartnerId = model.GetPartnerId() };

            _log.Info("Get referral information started", sanitizedModel);

            var result = await _referralService.GetReferralInformationAsync(model);

            _log.Info("Get referral information finished", sanitizedModel);

            return(result);
        }