示例#1
0
        public void TryGetStackTraceInformationReturnsStackTraceForAnException()
        {
            var exception = new DummyExceptionForStackTrace(() => "    at A()\r\n    at B()");

            var stackTraceInformation = exception.TryGetStackTraceInformation();

            StringAssert.StartsWith(stackTraceInformation.ErrorStackTrace, "    at A()");
            Assert.IsNull(stackTraceInformation.ErrorFilePath);
            Assert.AreEqual(0, stackTraceInformation.ErrorLineNumber);
        }
示例#2
0
        public void TryGetStackTraceInformationShouldThrowIfStackTraceThrows()
        {
            var exception = new DummyExceptionForStackTrace(() => { throw new NotImplementedException(); });

            exception.TryGetStackTraceInformation();
        }
示例#3
0
        public void TryGetStackTraceInformationReturnsNullIfExceptionStackTraceIsNullOrEmpty()
        {
            var exception = new DummyExceptionForStackTrace(() => null);

            Assert.IsNull(exception.TryGetStackTraceInformation());
        }