Beispiel #1
0
        public void JsonIsNull()
        {
            // arrange
            // act
            Action action = () => IntrospectionDeserializer.Deserialize(null);

            // assert
            Assert.Throws <ArgumentException>(action).Message.MatchSnapshot();
        }
Beispiel #2
0
        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();
        }
Beispiel #4
0
        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));
        }