mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
using System;
|
|
using System.IO;
|
|
using NLog;
|
|
using NLog.Config;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Providers;
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
[SetUpFixture]
|
|
public class Fixtures
|
|
{
|
|
[TearDown]
|
|
public void TearDown()
|
|
{
|
|
|
|
}
|
|
|
|
[SetUp]
|
|
public void SetUp()
|
|
{
|
|
try
|
|
{
|
|
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(new EnviromentProvider().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);
|
|
}
|
|
|
|
var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories);
|
|
foreach (var file in filesToDelete)
|
|
{
|
|
try
|
|
{
|
|
File.Delete(file);
|
|
}
|
|
catch { }
|
|
}
|
|
|
|
MockLib.CreateDataBaseTemplate();
|
|
}
|
|
}
|