public void apply_to_called_once()
        {
            var docExec     = new DocumentExecuter();
            var execOptions = new ExecutionOptions();

            execOptions.Schema = new Schema();
            var mockMiddleware = new ApplyCounterMiddlewareBuilder();

            execOptions.FieldMiddleware = mockMiddleware;

            docExec.ExecuteAsync(execOptions).Wait();

            Assert.Equal(1, mockMiddleware.AppliedCount);
        }
Esempio n. 2
0
        public void apply_to_not_called_without_execute()
        {
            //var docExec = new DocumentExecuter();
            var schema = new Schema();
            //var execOptions = new ExecutionOptions { Schema = schema };
            var mockMiddleware = new ApplyCounterMiddlewareBuilder();

            schema.FieldMiddleware = mockMiddleware;

            // no execute in this test
            //docExec.ExecuteAsync(execOptions).Wait();

            mockMiddleware.AppliedCount.ShouldBe(0);
        }
Esempio n. 3
0
        public void apply_to_not_called_without_execute()
        {
            var docExec     = new DocumentExecuter();
            var execOptions = new ExecutionOptions();

            execOptions.Schema = new Schema();
            var mockMiddleware = new ApplyCounterMiddlewareBuilder();

            execOptions.FieldMiddleware = mockMiddleware;

            // no execute in this test
            //docExec.ExecuteAsync(execOptions).Wait();

            Assert.Equal(0, mockMiddleware.AppliedCount);
        }
        public void apply_to_called_once()
        {
            var docExec     = new DocumentExecuter();
            var execOptions = new ExecutionOptions
            {
                Schema = new Schema(),
                Query  = "{ abcd }"
            };
            var mockMiddleware = new ApplyCounterMiddlewareBuilder();

            execOptions.FieldMiddleware = mockMiddleware;

            docExec.ExecuteAsync(execOptions).Wait();

            mockMiddleware.AppliedCount.ShouldBe(1);
        }