예제 #1
0
        public void capture_exception_text()
        {
            var errors = new StepResults();
            errors.CaptureException(new NotImplementedException().ToString());

            errors.ExceptionText.ShouldContain("NotImplementedException");
        }
예제 #2
0
        public void collapse_with_a_hierarchy()
        {
            var result = new StepResults();
            result.MoveFrame();
            result.MoveFrame();
            result.MoveFrame();
            result.CaptureException("bad");
            result.MoveFrame();
            result.MoveFrame();
            result.CaptureException("worse");

            result.Collapse();

            result.HasErrors().ShouldBeTrue();
            result.ExceptionText.ShouldContain("bad");
            result.ExceptionText.ShouldContain("worse");
        }
예제 #3
0
        public void capturing_an_exception_means_that_has_errors_should_be_true()
        {
            var errors = new StepResults();
            errors.HasErrors().ShouldBeFalse();

            errors.CaptureException(new NotImplementedException().ToString());
            errors.HasErrors().ShouldBeTrue();
        }
예제 #4
0
        public void capture_exception_text()
        {
            var errors = new StepResults();

            errors.CaptureException(new NotImplementedException().ToString());

            errors.ExceptionText.ShouldContain("NotImplementedException");
        }
예제 #5
0
        public void collapse_with_a_hierarchy()
        {
            var result = new StepResults();

            result.MoveFrame();
            result.MoveFrame();
            result.MoveFrame();
            result.CaptureException("bad");
            result.MoveFrame();
            result.MoveFrame();
            result.CaptureException("worse");

            result.Collapse();

            result.HasErrors().ShouldBeTrue();
            result.ExceptionText.ShouldContain("bad");
            result.ExceptionText.ShouldContain("worse");
        }
예제 #6
0
        public void capturing_an_exception_means_that_has_errors_should_be_true()
        {
            var errors = new StepResults();

            errors.HasErrors().ShouldBeFalse();

            errors.CaptureException(new NotImplementedException().ToString());
            errors.HasErrors().ShouldBeTrue();
        }
예제 #7
0
        public void capture_exception_with_frame()
        {
            var errors = new StepResults();
            errors.CaptureException("anything");

            errors.MoveFrame();

            errors.HasErrors().ShouldBeFalse();
            errors.ExceptionText.ShouldBeEmpty();
        }
예제 #8
0
        public void capture_exception_with_frame()
        {
            var errors = new StepResults();

            errors.CaptureException("anything");

            errors.MoveFrame();

            errors.HasErrors().ShouldBeFalse();
            errors.ExceptionText.ShouldBeEmpty();
        }
예제 #9
0
        public void capture_error_on_the_second_frame()
        {
            var errors = new StepResults();
            errors.MoveFrame();
            errors.CaptureException("anything");

            errors.MoveFirst();
            errors.HasErrors().ShouldBeFalse();

            errors.MoveFrame();
            errors.HasErrors().ShouldBeTrue();
        }
예제 #10
0
        public void capture_error_on_the_second_frame()
        {
            var errors = new StepResults();

            errors.MoveFrame();
            errors.CaptureException("anything");

            errors.MoveFirst();
            errors.HasErrors().ShouldBeFalse();

            errors.MoveFrame();
            errors.HasErrors().ShouldBeTrue();
        }
예제 #11
0
        public void collapse_is_idempotent()
        {
            var result = new StepResults();
            result.MoveFrame();
            result.MoveFrame();
            result.MoveFrame();
            result.CaptureException("bad");

            result.Collapse();
            result.Collapse();
            result.Collapse();

            result.ExceptionText.ShouldEqual("bad");
        }
예제 #12
0
        public void clear_will_clear_out_the_frame_errors()
        {
            var errors = new StepResults();
            errors.MoveFrame();
            errors.MoveFrame();
            errors.CaptureException("anything");

            errors.Clear();

            errors.MoveFirst();
            errors.MoveFrame();
            errors.MoveFrame();
            errors.HasErrors().ShouldBeFalse();
        }
예제 #13
0
        public void SetUp()
        {
            sentence = Sentence.For("{name} is {age}", Cell.For <string>("name"), Cell.For <int>("age"));
            step     = new Step().With("name:Max,age:6");
            tag      = new SentenceTag(sentence, step);

            context = new TestContext();
            StepResults results = context.ResultsFor(step);

            results.CaptureException("bad stuff");
            results.ExceptionText.ShouldEqual("bad stuff");


            tag.WriteResults(context);
        }
예제 #14
0
        public void clear_will_clear_out_the_frame_errors()
        {
            var errors = new StepResults();

            errors.MoveFrame();
            errors.MoveFrame();
            errors.CaptureException("anything");

            errors.Clear();

            errors.MoveFirst();
            errors.MoveFrame();
            errors.MoveFrame();
            errors.HasErrors().ShouldBeFalse();
        }
예제 #15
0
        public void collapse_is_idempotent()
        {
            var result = new StepResults();

            result.MoveFrame();
            result.MoveFrame();
            result.MoveFrame();
            result.CaptureException("bad");

            result.Collapse();
            result.Collapse();
            result.Collapse();

            result.ExceptionText.ShouldEqual("bad");
        }
예제 #16
0
        public void reset_clears_exception_text_and_has_errors()
        {
            var errors = new StepResults();

            errors.MarkMissingValue("a");
            errors.Clear();

            errors.HasErrors().ShouldBeFalse();
            errors.ExceptionText.ShouldBeEmpty();

            errors.CaptureException(new NotImplementedException().ToString());

            errors.Clear();

            errors.HasErrors().ShouldBeFalse();
            errors.ExceptionText.ShouldBeEmpty();
        }
예제 #17
0
        public void reset_clears_exception_text_and_has_errors()
        {
            var errors = new StepResults();
            errors.MarkMissingValue("a");
            errors.Clear();

            errors.HasErrors().ShouldBeFalse();
            errors.ExceptionText.ShouldBeEmpty();

            errors.CaptureException(new NotImplementedException().ToString());

            errors.Clear();

            errors.HasErrors().ShouldBeFalse();
            errors.ExceptionText.ShouldBeEmpty();
        }