Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        List <ReflectionTestCase> ResolveParameters(ReflectionTestSession session)
        {
            if (parameters != null)
            {
                return(parameters);
            }

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