示例#1
0
        protected void Exercise(Example example)
        {
            Context.AddExample(example);

            if(!example.Pending)
                example.Run(Context);
        }
示例#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;
            }
        }
示例#3
0
        protected void Exercise(Example example)
        {
            Context.AddExample(example);

            if (!example.Pending)
            {
                example.Run(Context);
            }
        }
示例#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();
        }
示例#5
0
文件: Context.cs 项目: legendz3/NSpec
        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;
            }
        }
示例#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;
            }
        }