Esempio n. 1
0
        public async Task SerilizesMutationValuesCorrectly_Stringified()
        {
            tester.AddQuery("./Files/StringifiedEnums/Mutation.gql");
            tester.Configure(s =>
            {
                s.TemplateSettings["StringifyEnums"] = "true";
            });

            var query = await tester.ExecuteClient("Sample.Client.Test", @"MutationQAsync(Episode.Newhope)");

            Assert.Equal("NEWHOPE", query.Variables["emp"]);
        }
Esempio n. 2
0
        public async Task NewtonsoftJsonConverter_Executes()
        {
            var tester = new CodeGeneratorTester();

            tester.AddQuery("./Files/ToggleJsonConverter/Query.gql");

            tester.Configure(x => x.TemplateSettings.Add("JsonConverter", "Newtonsoft.Json"));
            tester.ConfigureResponse(q => {
                return(new {
                    nullable = (string)null,
                    nonnullable = "EMPIRE"
                });
            });
            var code = await tester.Generate();

            var result = await tester.ExecuteClient();
        }