Пример #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}");
        }