Exemplo n.º 1
0
        public async Task GetDocumentTypesTest()
        {
            Dictionary <string, List <string> > expected = new Dictionary <string, List <string> > {
                { "test-key", new List <string> {
                      "test-list-value"
                  } }
            };

            mockServer
            .Given(
                Request.Create()
                .WithPath("/trial/configuration/v1/documentTypes/US")
                .WithHeader("x-trulioo-api-key", TEST_API_KEY)
                .UsingGet()
                )
            .RespondWith(
                Response.Create()
                .WithStatusCode(200)
                .WithHeader("Content-Type", "application/json")
                .WithBody(JsonConvert.SerializeObject(expected))
                );

            try
            {
                Dictionary <string, List <string> > result = configurationApi.GetDocumentTypes("trial", "US");
                Assert.Equal(result, expected);
            }
            catch (ApiException)
            {
                Assert.True(false, "Unexpected ApiException");
            }

            try
            {
                Dictionary <string, List <string> > result = await configurationApi.GetDocumentTypesAsync("trial", "US");

                Assert.Equal(result, expected);
            }
            catch (ApiException)
            {
                Assert.True(false, "Unexpected ApiException");
            }
        }