Ejemplo n.º 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.Record("Context", "Creation"))
                {
                    execution = _system.CreateContext();
                }

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

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

                SpecExecution.RunAll(context, plan);
            }
            finally
            {
                execution?.Dispose();
                context?.Dispose();
            }


            return(context.FinalizeResults(1));
        }
Ejemplo n.º 2
0
        public SpecResults Run(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();
            }

            var results = context.FinalizeResults(1);

            _records.Add(new BatchRecord
            {
                results       = results,
                specification = specification
            });

            return(results);
        }
Ejemplo n.º 3
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));
        }