Example #1
0
        public void MarkMissingStep()
        {
            var errors = new StepResults();

            errors.MarkMissingValue("a");

            errors.ExceptionText.ShouldEqual("\"a\" is not defined.");

            errors.MarkMissingValue("b");
            errors.ExceptionText.ShouldEqual("\"a\" is not defined.\n\"b\" is not defined.");
        }
Example #2
0
        public void marking_a_missing_value_should_set_HasErrors_to_true()
        {
            var errors = new StepResults();

            errors.HasErrors().ShouldBeFalse();

            errors.MarkMissingValue("a");

            errors.HasErrors().ShouldBeTrue();
        }
Example #3
0
        public void mark_as_exception()
        {
            var errors = new StepResults();

            errors.MarkFormatFailure("key1");
            errors.MarkMissingValue("key2");

            errors.IsInException("key1").ShouldBeTrue();
            errors.IsInException("key2").ShouldBeTrue();
            errors.IsInException("key3").ShouldBeFalse();
        }
Example #4
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();
        }
Example #5
0
        public void marking_a_missing_value_should_set_HasErrors_to_true()
        {
            var errors = new StepResults();
            errors.HasErrors().ShouldBeFalse();

            errors.MarkMissingValue("a");

            errors.HasErrors().ShouldBeTrue();
        }
Example #6
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();
        }
Example #7
0
        public void mark_as_exception()
        {
            var errors = new StepResults();
            errors.MarkFormatFailure("key1");
            errors.MarkMissingValue("key2");

            errors.IsInException("key1").ShouldBeTrue();
            errors.IsInException("key2").ShouldBeTrue();
            errors.IsInException("key3").ShouldBeFalse();
        }
Example #8
0
        public void MarkMissingStep()
        {
            var errors = new StepResults();
            errors.MarkMissingValue("a");

            errors.ExceptionText.ShouldEqual("\"a\" is not defined.");

            errors.MarkMissingValue("b");
            errors.ExceptionText.ShouldEqual("\"a\" is not defined.\n\"b\" is not defined.");
        }