Esempio n. 1
0
        public void Can_Have_Decimals_In_Schema()
        {
            var schema = Schema <SchemaTypeWithDecimal>();

            schema.ShouldHaveQueries(1);
            schema.ShouldHaveMutations(0);
            schema.Query.ShouldHaveFieldWithName("test");
            var result = schema.Execute((e) => e.Query = "query { test }");

            ResultHelpers.AssertNoErrorsInResult(result);
        }
        public void Schema_Will_Execute_With_No_Errors_When_A_Type_Is_In_A_Linq_Iterator()
        {
            const string query = @"{
                testSelectIterator
                testWhereIterator
            }";

            var schema = Schema <BugReproSchemaTaskFirst>();
            var result = schema.Execute((e) => e.Query = query);

            ResultHelpers.AssertNoErrorsInResult(result);
            string testSelectIterator = (string)JObject.Parse(result)["data"]["testSelectIterator"][0];
            string testWhereIterator  = (string)JObject.Parse(result)["data"]["testWhereIterator"][0];

            Assert.AreEqual("Test", testSelectIterator);
            Assert.AreEqual("Test", testWhereIterator);
        }
        public void Schema_Will_Execute_With_No_Errors_When_A_Type_Is_In_A_Task()
        {
            const string query = @"{
                holders {
                    items {
                        interfaceConnection {
                            test
                        }
                    }
                }
            }";

            var schema = Schema <BugReproSchemaTaskFirst>();
            var result = schema.Execute((e) => e.Query = query);

            ResultHelpers.AssertNoErrorsInResult(result);

            schema = Schema <BugReproSchemaTaskSecond>();
            result = schema.Execute((e) => e.Query = query);
            ResultHelpers.AssertNoErrorsInResult(result);
        }