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); }
public void TryGetStackTraceInformationShouldThrowIfStackTraceThrows() { var exception = new DummyExceptionForStackTrace(() => { throw new NotImplementedException(); }); exception.TryGetStackTraceInformation(); }
public void TryGetStackTraceInformationReturnsNullIfExceptionStackTraceIsNullOrEmpty() { var exception = new DummyExceptionForStackTrace(() => null); Assert.IsNull(exception.TryGetStackTraceInformation()); }