public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            var notify = CreateTaskNotificationFor(specification, _currentContext);

            notify(task => _server.TaskProgress(task, null));

            NotifyRedirectedOutput(notify, _specificationOutput);

            TaskResult taskResult = TaskResult.Success;
            string     message    = null;

            switch (result.Status)
            {
            case Status.Failing:
                _errors += 1;

                notify(task => _server.TaskExplain(task, result.Exception.Message));
                notify(task => _server.TaskException(task,
                                                     ExceptionResultConverter.ConvertExceptions(result.Exception, out message)));
                taskResult = TaskResult.Exception;
                break;

            case Status.Passing:
                _successes += 1;

                taskResult = TaskResult.Success;
                break;

            case Status.NotImplemented:
                notify(task => _server.TaskExplain(task, "Not implemented"));
                message    = "Not implemented";
                taskResult = TaskResult.Inconclusive;
                break;

            case Status.Ignored:
                notify(task => _server.TaskExplain(task, "Ignored"));
                taskResult = TaskResult.Skipped;
                break;
            }

            notify(task => _server.TaskFinished(task, message, taskResult));
        }
 /// <inheritdoc />
 public void TaskExplain(FacadeTask task, string explanation)
 {
     try
     {
         server.TaskExplain(GetRemoteTask(task), explanation);
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }
        public void OnSpecificationEnd(SpecificationInfo specification, Result result)
        {
            var notify = CreateTaskNotificationFor(specification);

            notify(task => _server.TaskProgress(task, null));

            notify(task => _server.TaskOutput(task, result.ConsoleOut, TaskOutputType.STDOUT));
            notify(task => _server.TaskOutput(task, result.ConsoleError, TaskOutputType.STDERR));

            TaskResult taskResult = TaskResult.Success;
            string     message    = null;

            switch (result.Status)
            {
            case Status.Failing:
                notify(task => _server.TaskExplain(task, result.Exception.Message));
                notify(task => _server.TaskException(task,
                                                     ExceptionResultConverter.ConvertExceptions(result.Exception, out message)));
                taskResult = TaskResult.Exception;
                break;

            case Status.Passing:
                taskResult = TaskResult.Success;
                break;

            case Status.NotImplemented:
                notify(task => _server.TaskExplain(task, "Not implemented"));
                message    = "Not implemented";
                taskResult = TaskResult.Skipped;
                break;

            case Status.Ignored:
                notify(task => _server.TaskExplain(task, "Ignored"));
                taskResult = TaskResult.Skipped;
                break;
            }

            notify(task => _server.TaskFinished(task, message, taskResult));
        }
        private void PublishTaskResult(RemoteTask task, FeatureResult result)
        {
            var    taskResult        = GetFeatureTaskResult(result);
            string taskResultMessage = "";

            if (taskResult == TaskResult.Skipped)
            {
                taskResultMessage = "Skipped";
            }
            if (taskResult == TaskResult.Inconclusive)
            {
                taskResultMessage = "Pending";
                server.TaskExplain(task, "See pending step(s) for more information");
            }
            if (taskResult == TaskResult.Error)
            {
                var failure = result.ScenarioResults.First(_ => _.Result is Failed).Result as Failed;
                taskResultMessage = failure.Exception.Message;
                var te = new TaskException(failure.Exception);
                server.TaskException(task, new[] { te });
            }
            server.TaskFinished(task, taskResultMessage, taskResult);
        }
 public void TaskExplain(RemoteTask remoteTask, string explanation)
 {
     ShouldContinue = server.TaskExplain(remoteTask, explanation);
 }