mirror of
https://github.com/Radarr/Radarr
synced 2024-12-30 20:05:41 +00:00
47 lines
No EOL
1.4 KiB
C#
47 lines
No EOL
1.4 KiB
C#
using System;
|
|
using System.IO;
|
|
using NLog;
|
|
using NLog.Config;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
namespace NzbDrone.Core.Test
|
|
{
|
|
[SetUpFixture]
|
|
public class Fixtures
|
|
{
|
|
[TearDown]
|
|
public void TearDown()
|
|
{
|
|
var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.db", SearchOption.AllDirectories);
|
|
foreach (var file in filesToDelete)
|
|
{
|
|
try
|
|
{
|
|
File.Delete(file);
|
|
}
|
|
catch{}
|
|
}
|
|
}
|
|
|
|
[SetUp]
|
|
public void SetUp()
|
|
{
|
|
try
|
|
{
|
|
LogManager.Configuration =
|
|
new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
|
|
LogManager.ThrowExceptions = true;
|
|
|
|
var exceptionVerification = new ExceptionVerification();
|
|
LogManager.Configuration.AddTarget("ExceptionVerification", exceptionVerification);
|
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, exceptionVerification));
|
|
LogManager.Configuration.Reload();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine("Unable to configure logging. " + e);
|
|
}
|
|
}
|
|
}
|
|
} |