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

            timings.Start(specification);

            IExecutionContext execution = null;

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

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

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

            var executor = new SynchronousExecutor(context);

            plan.AcceptVisitor(executor);



            execution.Dispose();
            context.Dispose();

            return(context.FinalizeResults(1));
        }
Ejemplo n.º 2
0
 public void Cancel()
 {
     _context.Dispose();
     _request.Cancel();
     _wasCancelled = true;
     _thread.Abort();
 }
Ejemplo n.º 3
0
        public void Cancel()
        {
            _context.Dispose();
            _request.Cancel();
            _wasCancelled = true;

#if NET46
            _thread.Abort();
#endif

            _reset.Set();
        }
Ejemplo n.º 4
0
        public SpecResults Execute(Specification specification)
        {
            var plan    = specification.CreatePlan(_library);
            var timings = new Timings();

            timings.Start(specification);

            IExecutionContext execution = null;

            var record = timings.Subject("Context", "Creation", 0);

            try
            {
                execution = _system.CreateContext();
            }
            finally
            {
                timings.End(record);
            }

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

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

            var gatherer = new LineStepGatherer(context);

            plan.AcceptVisitor(gatherer);

            foreach (var line in gatherer.Lines)
            {
                line.Execute(context);
            }

            execution.Dispose();
            context.Dispose();

            return(context.FinalizeResults(1));
        }