public async void GetByIdTest() { const string clientId = "5e4c1c52b83f3800124fc525"; const string clientSecret = "93c8b61ef98301c4bac73677b8be73"; const string publicKey = "ef0d740aef5ab5b25d094ad150ed05"; var client = new PlaidClient(Environment.Sandbox); var institutionRequest = new GetRequest() { Count = 1, Offset = 0, ClientId = clientId, Secret = clientSecret }; var institutionResults = await client.FetchAllInstitutionsAsync(institutionRequest); Assert.Null(institutionResults.Exception); Assert.True(institutionResults.IsSuccessStatusCode); Assert.True(institutionResults.Institutions.Length == 1); var idRequest = new SearchByIdRequest() { PublicKey = publicKey, InstitutionId = institutionResults.Institutions.FirstOrDefault()?.Id }; var idResults = await client.FetchInstitutionByIdAsync(idRequest); Assert.Null(idResults.Exception); Assert.True(idResults.IsSuccessStatusCode); Assert.NotNull(idResults.Institution); }
public async Task FetchInstitutionByIdAsync_should_retrieve_a_bank_that_matches_a_specified_id() { // Arrange using PlaidClient client = new PlaidClient { Environment = Environment.Sandbox }; // Act SearchByIdRequest request = new SearchByIdRequest { Institution = "ins_109511" }; SearchByIdResponse response = await client.FetchInstitutionByIdAsync(request); // Assert response.SuccessfulOutcome.ShouldBeTrue(); response.Request.ShouldNotBeNullOrEmpty(); response.Institution.Identifier.ShouldBe(request.Institution); }
public void FetchInstitutionByIdAsync_should_retrieve_a_bank_that_matches_a_specified_id() { // Arrange var sut = new PlaidClient(Environment.Sandbox); // Act var request = new Institution.SearchByIdRequest() { InstitutionId = "ins_109511" }.UseDefaults(); var response = sut.FetchInstitutionByIdAsync(request).Result; // Assert response.IsSuccessStatusCode.ShouldBeTrue(); response.RequestId.ShouldNotBeNullOrEmpty(); response.Institution.Id.ShouldBe(request.InstitutionId); }
public void Can_retrieve_institutions_by_id() { // Arrange var sut = new PlaidClient(Environment.Sandbox); var request = new Institution.SearchByIdRequest().UseDefaults(); request.InstitutionId = "ins_109511"; request.Options = new Institution.SearchByIdRequest.AdditionalOptions { InclueMetadata = true }; // Act var response = sut.FetchInstitutionByIdAsync(request).Result; // Assert response.IsSuccessStatusCode.ShouldBeTrue(); response.RequestId.ShouldNotBeNullOrEmpty(); response.Institution.Id.ShouldBe(request.InstitutionId); response.Institution.Name.ShouldNotBeNullOrEmpty(); }