コード例 #1
0
        public async Task GetSchemaFeatures_HttpClient_Is_Null()
        {
            // arrange
            var introspectionClient = new IntrospectionClient();

            // act
            Func <Task> action = () => introspectionClient.GetSchemaFeaturesAsync(null);

            // assert
            await Assert.ThrowsAsync <ArgumentNullException>(action);
        }
コード例 #2
0
        public async Task GetSchemaFeatures()
        {
            // arrange
            TestServer server = CreateStarWarsServer();
            var        introspectionClient = new IntrospectionClient();

            // act
            ISchemaFeatures features =
                await introspectionClient.GetSchemaFeaturesAsync(
                    server.CreateClient());

            // assert
            Assert.True(features.HasDirectiveLocations);
            Assert.True(features.HasRepeatableDirectives);
            Assert.True(features.HasSubscriptionSupport);
        }
コード例 #3
0
        public async Task GetSchemaFeatures()
        {
            // arrange
            TestServer server = CreateStarWarsServer();
            HttpClient client = server.CreateClient();

            client.BaseAddress = new Uri("http://localhost:5000/graphql");

            var introspectionClient = new IntrospectionClient();

            // act
            ISchemaFeatures features = await introspectionClient.GetSchemaFeaturesAsync(client);

            // assert
            Assert.True(features.HasDirectiveLocations);
            Assert.True(features.HasRepeatableDirectives);
            Assert.True(features.HasSubscriptionSupport);
        }