protected void Exercise(Example example)
        {
            Context.AddExample(example);

            if(!example.Pending)
                example.Run(Context);
        }
Beispiel #2
0
        public void Exercise(Example example, nspec nspec)
        {
            if (example.Pending)
            {
                return;
            }

            if (contextLevelFailure != null)
            {
                example.Exception = contextLevelFailure;
                return;
            }

            try
            {
                RunBefores(nspec);

                RunActs(nspec);

                example.Run(nspec);

                Afters();
            }
            catch (TargetInvocationException e)
            {
                example.Exception = e.InnerException;
            }
            catch (Exception e)
            {
                example.Exception = e;
            }
        }
Beispiel #3
0
        protected void Exercise(Example example)
        {
            Context.AddExample(example);

            if (!example.Pending)
            {
                example.Run(Context);
            }
        }
Beispiel #4
0
        public void should_be_marked_as_pending_if_parent_context_is_pending()
        {
            var context = new Context("pending context", 0, isPending: true);

            var example = new Example("example name");

            context.AddExample(example);

            example.Run(context);

            example.Pending.should_be_true();
        }
Beispiel #5
0
        public void Run(Example example, nspec nspec)
        {
            if (example.Pending)
            {
                return;
            }

            try
            {
                RunBefores(nspec);

                RunActs(nspec);

                example.Run(nspec);

                Afters();
            }
            catch (Exception e)
            {
                example.Exception = e;
            }
        }
Beispiel #6
0
        public void Exercise(Example example, nspec nspec)
        {
            if (example.Pending) return;

            if (contextLevelFailure != null)
            {
                example.Exception = contextLevelFailure;
                return;
            }

            try
            {
                RunBefores(nspec);

                RunActs(nspec);

                example.Run(nspec);

                Afters();
            }
            catch (TargetInvocationException e)
            {
                example.Exception = e.InnerException;
            }
            catch (Exception e)
            {
                example.Exception = e;
            }
        }