public async Task <TestResult> Run(ReflectionTestSession session, CancellationToken cancellationToken)
        {
            var ctx = session.RootContext;

            var result   = new TestResult(Node.Path);
            var childCtx = ctx.CreateChild(Node.Path, result);

            bool        ok;
            TestInvoker invoker;

            try {
                invoker = Node.CreateInvoker(ctx);
                ok      = await invoker.Invoke(childCtx, null, cancellationToken);
            } catch (Exception ex) {
                result.AddError(ex);
                ok = false;
            }

            if (!ok && result.Status == TestStatus.Success)
            {
                result.Status = TestStatus.Error;
            }

            return(result);
        }
        List <ReflectionTestCase> ResolveParameters(ReflectionTestSession session)
        {
            if (parameters != null)
            {
                return(parameters);
            }

            Node.Resolve(session.RootContext);
            parameters = new List <ReflectionTestCase> ();
            AddParameters(session.RootContext, Node);
            return(parameters);
        }
 public Task <IReadOnlyCollection <TestCase> > GetParameters(ReflectionTestSession session, CancellationToken cancellationToken)
 {
     return(Task.Run <IReadOnlyCollection <TestCase> > (() => ResolveParameters((ReflectionTestSession)session)));
 }