protected override StepResult execute(ISpecContext context) { var result = new StepResult(_values.id, ResultStatus.error) { error = Message }; return result; }
protected override StepResult execute(ISpecContext context) { var cellResults = _grammar.Execute(Values, context); var result = new StepResult(Values.id, ResultStatus.ok) { cells = cellResults.ToArray() }; return result; }
public void serialize_status() { var result = new StepResult("foo", ResultStatus.ok) { cells = new[] { CellResult.Error("a", "bad!"), CellResult.Error("b", "worse!"), CellResult.Success("c"), CellResult.Failure("d", "different"), CellResult.Failure("e", "different"), CellResult.Failure("f", "different"), } }; var json = JsonSerialization.ToCleanJson(result); json.ShouldContain("\"status\":\"ok\""); }
public void modify_increments_with_cell_results() { var result = new StepResult("foo", ResultStatus.ok) { cells = new[] { CellResult.Error("a", "bad!"), CellResult.Error("b", "worse!"), CellResult.Success("c"), CellResult.Failure("d", "different"), CellResult.Failure("e", "different"), CellResult.Failure("f", "different"), } }; var counts = new Counts(); result.Tabulate(counts); counts.ShouldEqual(1, 3, 2, 0); }
protected bool Equals(StepResult other) { return(string.Equals(position, other.position) && status == other.status && string.Equals(error, other.error) && string.Equals(id, other.id)); }
private static SpecResults buildResultsForContextCreationFailure(SpecExecutionRequest request, Exception ex, Timings timings) { var result = new StepResult(request.Specification.id, ex) {position = Stage.context}; var perf = timings.Finish(); return new SpecResults { Attempts = request.Plan.Attempts, Duration = timings.Duration, Performance = perf.ToArray(), Counts = new Counts(0, 0, 1, 0), Results = new IResultMessage[] { result } }; }
private StepResult timeoutMessage() { var stepResult = new StepResult { id = _request.Plan.Specification.id, status = ResultStatus.error, error = "Timed out in " + _timings.Duration + " milliseconds", position = Stage.timedout }; return stepResult; }
protected bool Equals(StepResult other) { return string.Equals(position, other.position) && status == other.status && string.Equals(error, other.error) && string.Equals(id, other.id); }