Exemple #1
0
        public ExecutionResult AssertQuery(Action <ExecuteConfig> configure)
        {
            var config = new ExecuteConfig();

            configure(config);

            var schema = Builder.Build(config.Definitions);

            config.ConfigureBuildedSchema?.Invoke(schema);
            schema.Initialize();

            var queryResult = CreateQueryResult(config.ExpectedResult);

            return(AssertQuery(
                       _ =>
            {
                _.Schema = schema;
                _.Query = config.Query;
                _.Inputs = config.Variables.ToInputs();
                _.Root = config.Root;
                _.ThrowOnUnhandledException = config.ThrowOnUnhandledException;
                _.Listeners.AddRange(config.Listeners);
            },
                       queryResult));
        }
        public ExecutionResult AssertQuery(Action <ExecuteConfig> configure)
        {
            var config = new ExecuteConfig();

            configure(config);

            var schema = Builder.Build(config.Definitions);

            schema.Initialize();

            var queryResult = CreateQueryResult(config.ExpectedResult);

            return(AssertQuery(_ =>
            {
                _.Schema = schema;
                _.Query = config.Query;
                _.Inputs = config.Variables.ToInputs();
            }, queryResult));
        }