public void JsonIsNull() { // arrange // act Action action = () => IntrospectionDeserializer.Deserialize(null); // assert Assert.Throws <ArgumentException>(action).Message.MatchSnapshot(); }
public void DeserializeStarWarsIntrospectionResult() { // arrange string json = FileResource.Open("StarWarsIntrospectionResult.json"); // act DocumentNode schema = IntrospectionDeserializer.Deserialize(json); // assert SchemaSyntaxSerializer.Serialize(schema).MatchSnapshot(); }
public void DeserializeIntrospectionWithIntDefaultValues() { // arrange string json = FileResource.Open("IntrospectionWithDefaultValues.json"); // act DocumentNode schema = IntrospectionDeserializer.Deserialize(json); // assert SchemaSyntaxSerializer.Serialize(schema).MatchSnapshot(); }
private static async Task <DocumentNode> ExecuteIntrospectionAsync( HttpClient httpClient, HttpQueryClient queryClient, SchemaFeatures features) { DocumentNode query = CreateIntrospectionQuery(features); var request = new HttpQueryRequest { Query = QuerySyntaxSerializer.Serialize(query) }; string json = await queryClient.FetchStringAsync( request, httpClient) .ConfigureAwait(false); return(IntrospectionDeserializer.Deserialize(json)); }
private static async Task <DocumentNode> ExecuteIntrospectionAsync( HttpClient httpClient, HttpQueryClient queryClient, SchemaFeatures features) { DocumentNode query = CreateIntrospectionQuery(features); var request = new HttpQueryRequest { Query = QuerySyntaxSerializer.Serialize(query), OperationName = "introspection_phase_2" }; (string json, HttpResponseMessage _)response = await queryClient.FetchStringAsync( request, httpClient) .ConfigureAwait(false); return(IntrospectionDeserializer.Deserialize(response.json)); }