Exemple #1
0
        public void FetchInstitutionsAsync_should_retrieve_a_list_of_500_banks()
        {
            // Arrange
            var sut = new PlaidClient(Environment.Sandbox);

            // Act
            var request = new Institution.GetRequest()
            {
                Offset  = 0,
                Count   = 500,
                Options = new Institution.GetOptions {
                    IncludeOptionalMetadata = true
                }
            }.UseDefaults();

            var result = sut.FetchInstitutionsAsync(request).Result;

            // Assert
            result.IsSuccessStatusCode.ShouldBeTrue();
            result.RequestId.ShouldNotBeNullOrEmpty();
            result.Institutions.Length.ShouldBe(500);
            result.Institutions.Where(i => i.Logo != null).ShouldNotBeEmpty();
            foreach (var i in result.Institutions)
            {
                i.Url.ShouldNotBeNullOrEmpty();
            }
        }
Exemple #2
0
        public async void SearchTest()
        {
            const string clientId     = "5e4c1c52b83f3800124fc525";
            const string clientSecret = "93c8b61ef98301c4bac73677b8be73";
            const string publicKey    = "ef0d740aef5ab5b25d094ad150ed05";

            var client             = new PlaidClient(Environment.Sandbox);
            var institutionRequest = new SearchByIdRequest()
            {
                PublicKey = publicKey,
            };
            var institutionResults = await client.FetchInstitutionsAsync(institutionRequest);

            Assert.Null(institutionResults.Exception);
            Assert.True(institutionResults.Institutions.Length == 10);
        }
Exemple #3
0
        public void Can_retrieve_institutions_by_name()
        {
            // Arrange
            var sut = new PlaidClient(Environment.Sandbox);

            // Act
            var request = new Institution.SearchRequest()
            {
                Query = "citi"
            }.UseDefaults();
            var result = sut.FetchInstitutionsAsync(request).Result;

            // Assert
            result.IsSuccessStatusCode.ShouldBeTrue();
            result.RequestId.ShouldNotBeNullOrEmpty();
            result.Institutions.Length.ShouldBeGreaterThanOrEqualTo(1);
            result.Institutions.ShouldAllBe(i => i.Name.ToLower().Contains(request.Query.ToLower()));
        }
Exemple #4
0
        public async Task FetchInstitutionsAsync_should_retrieve_a_list_of_banks_that_matches_a_specified_query()
        {
            // Arrange
            using PlaidClient sut = new PlaidClient { Environment = Environment.Sandbox };

            // Act
            SearchRequest request = new SearchRequest {
                Query = "tartan"
            };

            SearchResponse result = await sut.FetchInstitutionsAsync(request);

            // Assert
            result.SuccessfulOutcome.ShouldBeTrue();
            result.Request.ShouldNotBeNullOrEmpty();
            result.Institutions.Length.ShouldBeGreaterThanOrEqualTo(1);
            result.Institutions.ShouldAllBe(i => i.Name.ToLower().Contains(request.Query.ToLower()));
        }
Exemple #5
0
        public void FetchInstitutionsAsync_should_retrieve_a_list_of_banks_that_matches_a_specified_query()
        {
            // Arrange
            var sut = new PlaidClient(Environment.Sandbox);

            // Act
            var request = new Institution.SearchRequest()
            {
                Query = "tartan"
            }.UseDefaults();

            var result = sut.FetchInstitutionsAsync(request).Result;

            // Assert
            result.IsSuccessStatusCode.ShouldBeTrue();
            result.RequestId.ShouldNotBeNullOrEmpty();
            result.Institutions.Length.ShouldBeGreaterThanOrEqualTo(1);
            result.Institutions.ShouldAllBe(i => i.Name.ToLower().Contains(request.Query.ToLower()));
        }