Esempio n. 1
0
        public async Task GetInstitutionNotFound()
        {
            IHttpClientWrapper httpClient = this.GetMockHttpClient("InstitutionNotFound.json", HttpStatusCode.NotFound, HttpMethod.Get, "institutions/notexists");
            IPlaidClient       testClient = this.GetPlaidClient(httpClient);
            var result = await testClient.GetInstitutionAsync("notexists");

            Assert.IsNull(result.Value);
            Assert.IsTrue(result.IsError);

            Assert.IsNotNull(result.Exception);
            Assert.AreEqual(404, result.Exception.HttpStatusCode);
            Assert.AreEqual(ErrorCode.InstitutionNotFound, result.Exception.ErrorCode);
            Assert.IsFalse(string.IsNullOrWhiteSpace(result.Exception.Message));
            Assert.IsFalse(string.IsNullOrWhiteSpace(result.Exception.Resolution));
        }
Esempio n. 2
0
        public async Task GetInstitutionSuccess()
        {
            string             instId     = "531ea6327de8211c80000440";
            IHttpClientWrapper httpClient = this.GetMockHttpClient("Institution.json", HttpStatusCode.OK, HttpMethod.Get, "institutions/" + instId);
            IPlaidClient       testClient = this.GetPlaidClient(httpClient);
            var result = await testClient.GetInstitutionAsync(instId);

            Assert.IsNotNull(result.Value);
            Assert.IsFalse(result.IsError);

            Assert.AreEqual(instId, result.Value.Id);
            Assert.AreEqual(InstitutionType.UsBank, result.Value.Type);
            Assert.IsNotNull(result.Value.MfaDescriptions);
            Assert.IsTrue(result.Value.MfaDescriptions.Count > 0);
            Assert.IsTrue(result.Value.HasMfa);
            Assert.AreEqual("Personal ID", result.Value.UsernameHint);
            Assert.AreEqual("Password", result.Value.PasswordHint);
        }