예제 #1
0
        public void OwnStackTraceIsOmitted()
        {
            var exception = GetCaughtException();
            var uncheckedExceptionInWhenActionFound = new UncheckedExceptionInWhenActionFound(exception);

            uncheckedExceptionInWhenActionFound.StackTrace.Should()
            .Be($"Stack trace of {nameof(UncheckedExceptionInWhenActionFound)} is omitted.");
        }
예제 #2
0
        public void MessageContainsOriginalMessageAndStackTrace()
        {
            var exception = GetCaughtException();
            var uncheckedExceptionInWhenActionFound = new UncheckedExceptionInWhenActionFound(exception);

            uncheckedExceptionInWhenActionFound.Message.Should().Be(
                $"{Environment.NewLine}" +
                $"Exception was thrown in When action and no exception check was made:{Environment.NewLine}" +
                $"{Environment.NewLine}" +
                $"{exception.Message}{Environment.NewLine}" +
                $"{exception.StackTrace}{Environment.NewLine}");
        }