Exemple #1
0
        private async Task <string> GetSettingsAsync(
            TestServer server,
            string path)
        {
            HttpResponseMessage response =
                await server.HttpClient.GetAsync(
                    TestServerExtensions.CreateUrl(path));

            response.EnsureSuccessStatusCode();
            return(await response.Content.ReadAsStringAsync());
        }
        public async Task UseGraphQLHttpGetSchema_BuilderServices()
        {
            // arrange
            TestServer server = ServerFactory.Create(
                services => services.AddStarWars(),
                (app, sp) => app.UseGraphQLHttpGetSchema(sp));

            HttpClient client = server.HttpClient;

            string uri = TestServerExtensions.CreateUrl(null);

            // act
            HttpResponseMessage message = await client.GetAsync(uri);

            // assert
            string s = await message.Content.ReadAsStringAsync();

            s.MatchSnapshot();
        }