public void Arrange()
        {
            var fixture = new Fixture();

            _provider   = fixture.Create <Provider>();
            _repository = new Mock <IProviderRepository>();
            _repository.Setup(x => x.GetProvider(Ukprn)).ReturnsAsync(_provider);
            _handler = new GetProviderQueryHandler(_repository.Object);
        }
        public async Task Then_Gets_Provider_From_Courses_Api(
            GetProviderQuery query,
            GetProviderResponse apiResponse,
            [Frozen] Mock <ICourseDeliveryApiClient <CourseDeliveryApiConfiguration> > mockApiClient,
            GetProviderQueryHandler handler)
        {
            mockApiClient
            .Setup(client => client.Get <GetProviderResponse>(It.Is <GetProviderRequest>(request => request.Ukprn == query.Ukprn)))
            .ReturnsAsync(apiResponse);

            var result = await handler.Handle(query, CancellationToken.None);

            result.Provider.Should().BeEquivalentTo(apiResponse);
        }
        public async Task Then_The_Api_Is_Called_With_The_Request_And_Providers_Returned(
            GetProviderQuery query,
            GetProvidersListItem apiResponse,
            [Frozen] Mock <ICourseDeliveryApiClient <CourseDeliveryApiConfiguration> > apiClient,
            GetProviderQueryHandler handler
            )
        {
            apiClient.Setup(x =>
                            x.Get <GetProvidersListItem>(
                                It.Is <GetProviderRequest>(c => c.GetUrl.Equals($"api/providers/{query.Id}"))))
            .ReturnsAsync(apiResponse);

            var actual = await handler.Handle(query, CancellationToken.None);

            actual.Provider.Should().BeEquivalentTo(apiResponse);
        }
        public async Task Then_Gets_Provider_From_The_Service_By_Ukprn(
            GetProviderQuery query,
            Domain.Models.ProviderSummary provider,
            [Frozen] Mock <IProviderService> providerService,
            GetProviderQueryHandler handler)
        {
            //Arrange
            providerService
            .Setup(x => x.GetProviderByUkprn(query.Ukprn))
            .ReturnsAsync(provider);

            //Act
            var actual = await handler.Handle(query, It.IsAny <CancellationToken>());

            //Assert
            actual.Provider.Should().BeEquivalentTo(provider);
        }