public void Non_matching_UKPRN_returns_no_results() { var ukprn = 99998888; var client = new UkrlpApiClient(_logger.Object, _config.Object, new HttpClient(), new UkrlpSoapSerializer()); var result = client.GetTrainingProviderByUkprn(ukprn).GetAwaiter().GetResult(); result.Should().NotBeNull(); result.Results.Count.Should().Be(0); }
public async Task Then_Returns_Multiple_Ukprns() { //Arrange var ukprns = new List <long> { 10012385, 10006287 }; var client = new UkrlpApiClient(_logger.Object, _config.Object, new HttpClient(), new UkrlpSoapSerializer()); //Act var result = await client.GetListOfTrainingProviders(ukprns); result.Results.Count.Should().Be(2); result.Results.Select(c => c.UKPRN).Should().Contain(ukprns.Select(c => c.ToString())); }
public void Matching_UKPRN_has_a_primary_verification_source() { var ukprn = 10006287; var client = new UkrlpApiClient(_logger.Object, _config.Object, new HttpClient(), new UkrlpSoapSerializer()); var result = client.GetTrainingProviderByUkprn(ukprn).GetAwaiter().GetResult(); result.Should().NotBeNull(); result.Results.Count.Should().Be(1); var matchResult = result.Results[0]; matchResult.UKPRN.Should().Be(ukprn.ToString()); var primaryVerification = matchResult.VerificationDetails.FirstOrDefault(x => x.PrimaryVerificationSource == true); primaryVerification.VerificationAuthority.Should().Be("Charity Commission"); }
public void Matching_UKPRN_returns_single_result() { var ukprn = 10012385; var client = new UkrlpApiClient(_logger.Object, _config.Object, new HttpClient(), new UkrlpSoapSerializer()); var result = client.GetTrainingProviderByUkprn(ukprn).GetAwaiter().GetResult(); result.Should().NotBeNull(); result.Results.Count.Should().Be(1); var matchResult = result.Results[0]; matchResult.UKPRN.Should().Be(ukprn.ToString()); matchResult.ProviderStatus.Should().Be("Active"); matchResult.ContactDetails.FirstOrDefault(x => x.ContactType == "L").Should().NotBeNull(); matchResult.VerificationDate.Should().NotBeNull(); matchResult.VerificationDetails .FirstOrDefault(x => x.VerificationAuthority == "Charity Commission") .Should().NotBeNull(); matchResult.ProviderAliases.Count.Should().Be(1); }