/// <summary>
        /// Evaluates a given <paramref name="workspace"/> using a given <paramref name="interpreter"/>.
        /// The result of the evaluation is a <see cref="PipGraph"/>.
        /// </summary>
        public async Task <PipGraph> EvaluateAsync(Workspace workspace, Interpreter interpreter)
        {
            var testResult = await EvaluateNoErrorCheckAsync(workspace, interpreter);

            XAssert.IsFalse(testResult.HasError, "Evaluation failed");
            var pipGraphBuilder = (IPipGraphBuilder)interpreter.PipGraph;

            return(pipGraphBuilder.Build());
        }
        /// <summary>
        /// Evaluates a given <paramref name="workspace"/> using a given <paramref name="interpreter"/>
        /// without checking for errors or building pip graph.  Any errors can be retrieved
        /// via the <see cref="CreateTestResult"/> method.
        /// </summary>
        public async Task <TestResult <Interpreter> > EvaluateNoErrorCheckAsync(Workspace workspace, Interpreter interpreter)
        {
            var emptyQualifierId = interpreter.FrontEndContext.QualifierTable.EmptyQualifierId;

            interpreter.SetWorkspaceForTesting(workspace);
            var evaluationTasks = NonPreludeModules(workspace).Select(m => interpreter.EvaluateAsync(
                                                                          EvaluationFilter.Empty,
                                                                          emptyQualifierId));
            await Task.WhenAll(evaluationTasks);

            return(new TestResult <Interpreter>(interpreter, Diagnostics));
        }