public async Task GetCountrySubdivisionsTest() { List <CountrySubdivision> expected = new List <CountrySubdivision> { new CountrySubdivision(name: "California", code: "US-CA", parentCode: "US") }; mockServer .Given( Request.Create() .WithPath("/trial/configuration/v1/countrysubdivisions/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 { List <CountrySubdivision> result = configurationApi.GetCountrySubdivisions("trial", "US"); Assert.Equal(result, expected); } catch (ApiException) { Assert.True(false, "Unexpected ApiException"); } try { List <CountrySubdivision> result = await configurationApi.GetCountrySubdivisionsAsync("trial", "US"); Assert.Equal(result, expected); } catch (ApiException) { Assert.True(false, "Unexpected ApiException"); } }