Beispiel #1
0
        public SpecResults Execute(Specification specification)
        {
            var plan    = specification.CreatePlan(_library);
            var timings = new Timings();

            _warmup.Wait(1.Minutes());

            timings.Start(specification);

            IExecutionContext execution = null;
            SpecContext       context   = null;

            try
            {
                using (timings.Subject("Context", "Creation"))
                {
                    execution = _system.CreateContext();
                }

                context = new SpecContext(specification, timings, new NulloResultObserver(), StopConditions,
                                          execution);

                context.Reporting.As <Reporting>().StartDebugListening();

                var executor = new SynchronousExecutor(context);
                plan.AcceptVisitor(executor);
            }
            finally
            {
                if (execution != null)
                {
                    execution.Dispose();
                }
                if (context != null)
                {
                    context.Dispose();
                }
            }


            return(context.FinalizeResults(1));
        }
        public SpecResults Execute(Specification specification)
        {
            var plan    = specification.CreatePlan(_running.Fixtures);
            var timings = new Timings();

            _warmup.Wait(1.Minutes());

            timings.Start(specification);

            IExecutionContext execution = null;
            SpecContext       context   = null;

            try
            {
                using (timings.Record("Context", "Creation"))
                {
                    execution = _running.System.CreateContext();
                }

                context = new SpecContext(specification, timings, new NulloResultObserver(), StopConditions,
                                          execution);

                execution.BeforeExecution(context);

                context.Reporting.As <Reporting>().StartDebugListening();

                SpecExecution.RunAll(context, plan);

                execution.AfterExecution(context);
            }
            finally
            {
                execution?.Dispose();
                context?.Dispose();
            }


            return(context.FinalizeResults(1));
        }
Beispiel #3
0
        public static SpecContext ForTesting()
        {
            SpecContext context = Basic();

            return(context);
        }