|
|
|
@ -20,7 +20,21 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
|
|
|
|
|
|
|
|
|
private static Exception[] FilteredExceptions = new Exception[]
|
|
|
|
|
{
|
|
|
|
|
new UnauthorizedAccessException()
|
|
|
|
|
new UnauthorizedAccessException(),
|
|
|
|
|
new AggregateException(new Exception[]
|
|
|
|
|
{
|
|
|
|
|
new UnauthorizedAccessException(),
|
|
|
|
|
new UnauthorizedAccessException()
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private static Exception[] NonFilteredExceptions = new Exception[]
|
|
|
|
|
{
|
|
|
|
|
new AggregateException(new Exception[]
|
|
|
|
|
{
|
|
|
|
|
new UnauthorizedAccessException(),
|
|
|
|
|
new NotImplementedException()
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
@ -63,6 +77,14 @@ namespace NzbDrone.Common.Test.InstrumentationTests
|
|
|
|
|
_subject.IsSentryMessage(log).Should().BeFalse();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
[TestCaseSource("NonFilteredExceptions")]
|
|
|
|
|
public void should_not_filter_event_for_filtered_exception_types(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
var log = GivenLogEvent(LogLevel.Error, ex, "test");
|
|
|
|
|
_subject.IsSentryMessage(log).Should().BeTrue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
[TestCaseSource("FilteredExceptions")]
|
|
|
|
|
public void should_not_filter_event_for_filtered_exception_types_if_filtering_disabled(Exception ex)
|
|
|
|
|