public void modify_counts_when_in_error_state()
        {
            var counts = new Counts();

            CellResult.Error("a", "bad message").Tabulate(counts);

            counts.ShouldEqual(0, 0, 1, 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\"");
        }
        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);
        }
Пример #4
0
 public void LogError(string key, string message)
 {
     Errors.Add(CellResult.Error(key, message));
 }
Пример #5
0
 public void LogError(string key, Exception ex)
 {
     Errors.Add(CellResult.Error(key, ex));
 }
Пример #6
0
 public void LogError(string key, Exception ex)
 {
     Errors.Add(CellResult.Error(key, ex.ToDisplayMessage()));
 }
        public void unwrap_storyteller_assertion_exceptions()
        {
            var ex = new StorytellerAssertionException("Something is wrong");

            CellResult.Error("foo", ex).error.ShouldBe("Something is wrong");
        }