Better check against internal server error exceptions during unit tests.

This commit is contained in:
kay.one 2012-02-25 11:57:56 -08:00
parent 67298d62a0
commit 11db27f6ac
4 changed files with 11 additions and 9 deletions

View file

@ -78,19 +78,18 @@ namespace NzbDrone.Test.Common
{
var inconclusiveLogs = _logs.Where(l => l.Exception != null && l.Exception.GetType() == exception).ToList();
if (inconclusiveLogs.Count != 0)
if (inconclusiveLogs.Any())
{
inconclusiveLogs.ForEach(c => _logs.Remove(c));
Assert.Inconclusive(GetLogsString(inconclusiveLogs));
}
}
public static void MarkInconclusive(string text)
{
var inconclusiveLogs = _logs.Where(l => l.FormattedMessage.Contains(text)).ToList();
var inconclusiveLogs = _logs.Where(l => l.FormattedMessage.ToLower().Contains(text.ToLower())).ToList();
if (inconclusiveLogs.Count != 0)
if (inconclusiveLogs.Any())
{
inconclusiveLogs.ForEach(c => _logs.Remove(c));
Assert.Inconclusive(GetLogsString(inconclusiveLogs));