mirror of
https://github.com/Lidarr/Lidarr
synced 2026-01-14 11:32:36 +01:00
New: Anime support New: pull alternate names from thexem.de New: Search using all alternate names (if rage ID is unavailable) New: Show scene mapping information when hovering over episode number New: Full season searching for anime (searches for each episode) New: animezb.com anime indexer New: Treat BD as bluray Fixed: Parsing of 2 digit absolute episode numbers Fixed: Loading series details page for series that start with period Fixed: Return 0 results when manual search fails, instead of an error Fixed: animezb URL
57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using NLog;
|
|
using NLog.Config;
|
|
using NLog.Targets;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
namespace NzbDrone.Test.Common
|
|
{
|
|
public abstract class LoggingTest
|
|
{
|
|
protected static Logger TestLogger;
|
|
|
|
protected static void InitLogging()
|
|
{
|
|
new StartupContext();
|
|
|
|
TestLogger = LogManager.GetLogger("TestLogger");
|
|
|
|
if (LogManager.Configuration == null || LogManager.Configuration is XmlLoggingConfiguration)
|
|
{
|
|
LogManager.Configuration = new LoggingConfiguration();
|
|
var consoleTarget = new ConsoleTarget { Layout = "${level}: ${message} ${exception}" };
|
|
LogManager.Configuration.AddTarget(consoleTarget.GetType().Name, consoleTarget);
|
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, consoleTarget));
|
|
|
|
RegisterExceptionVerification();
|
|
}
|
|
}
|
|
|
|
private static void RegisterExceptionVerification()
|
|
{
|
|
var exceptionVerification = new ExceptionVerification();
|
|
LogManager.Configuration.AddTarget("ExceptionVerification", exceptionVerification);
|
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Warn, exceptionVerification));
|
|
}
|
|
|
|
[SetUp]
|
|
public void LoggingTestSetup()
|
|
{
|
|
InitLogging();
|
|
ExceptionVerification.Reset();
|
|
}
|
|
|
|
[TearDown]
|
|
public void LoggingDownBase()
|
|
{
|
|
|
|
|
|
//can't use because of a bug in mono with 2.6.2,
|
|
//https://bugs.launchpad.net/nunitv2/+bug/1076932
|
|
if (BuildInfo.IsDebug && TestContext.CurrentContext.Result.State == TestState.Success)
|
|
{
|
|
ExceptionVerification.AssertNoUnexpectedLogs();
|
|
}
|
|
}
|
|
}
|
|
}
|