public void CreateSourceLocation_NoFrames() { var exception = new Exception(); var location = ERUtils.CreateSourceLocation(exception); Assert.Equal(s_emptyLocation, location); }
public void CreateSourceLocation() { Exception exception; try { throw new Exception(); } catch (Exception e) { exception = e; } var location = ERUtils.CreateSourceLocation(exception); if (ErrorReportingUtils.IsWindows) { Assert.NotEmpty(location.FilePath); Assert.True(location.LineNumber > 0); } Assert.Equal(nameof(CreateSourceLocation), location.FunctionName); }
public void CreateSourceLocation_Null() { var location = ERUtils.CreateSourceLocation(null); Assert.Equal(s_emptyLocation, location); }