상속: StoryTeller.Messages.ClientMessage, IResultMessage
예제 #1
0
        protected override StepResult execute(ISpecContext context)
        {
            var result = new StepResult(_values.id, ResultStatus.error)
            {
                error = Message
            };

            return result;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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\"");
        }
예제 #4
0
        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);
        }
예제 #5
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));
 }
예제 #6
0
        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
                }
            };
        }
예제 #7
0
 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;
 }
예제 #8
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);
 }