public async Task ThenItShouldGetProviderFromApiIfReadFromLive()
        {
            var ukprn = _fixture.Create <long>();

            await _manager.GetLearningProviderAsync(ukprn.ToString(), null, true, null, _cancellationToken);

            _ukrlpApiClientMock.Verify(c => c.GetProviderAsync(ukprn, _cancellationToken),
                                       Times.Once);
            _providerRepository.Verify(c => c.GetProviderAsync(ukprn, _cancellationToken),
                                       Times.Never);
        }
Esempio n. 2
0
        public async Task ThenItShouldGetEstablishmentFromApiIfReadFromLive(int urn, string fields)
        {
            await _manager.GetLearningProviderAsync(urn.ToString(), fields, true, null, _cancellationToken);

            _giasApiClientMock.Verify(c => c.GetEstablishmentAsync(urn, _cancellationToken),
                                      Times.Once);
            _establishmentRepository.Verify(c => c.GetEstablishmentAsync(It.IsAny <int>(), It.IsAny <CancellationToken>()),
                                            Times.Never);
        }