public async Task GetFieldsTest() { JObject expected = new JObject(); expected.Add("title", "test-title"); expected.Add("type", "object"); JObject expectedProperties = new JObject(); expectedProperties.Add("PersonInfo", new JObject()); expected.Add("properties", expectedProperties); mockServer .Given( Request.Create() .WithPath("/trial/configuration/v1/fields/Identity Verification/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 { Object result = configurationApi.GetFields("trial", "Identity Verification", "US"); Assert.Equal(result, expected); } catch (ApiException) { Assert.True(false, "Unexpected ApiException"); } try { Object result = await configurationApi.GetFieldsAsync("trial", "Identity Verification", "US"); Assert.Equal(result, expected); } catch (ApiException) { Assert.True(false, "Unexpected ApiException"); } }