1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-30 20:05:41 +00:00
Radarr/NzbDrone.Core.Test/Framework/Fixtures.cs

50 lines
1.3 KiB
C#
Raw Normal View History

2010-09-30 06:59:00 +00:00
using System;
using System.IO;
using NLog;
using NLog.Config;
2011-06-02 21:06:46 +00:00
using NUnit.Framework;
using NzbDrone.Core;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Test.Framework;
2010-09-30 06:59:00 +00:00
[SetUpFixture]
public class Fixtures
2010-09-30 06:59:00 +00:00
{
[TearDown]
public void TearDown()
2010-09-30 06:59:00 +00:00
{
}
[SetUp]
public void SetUp()
{
try
2010-09-30 06:59:00 +00:00
{
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(new EnviromentProvider().AppPath, "log.config"), false);
LogManager.ThrowExceptions = true;
2011-07-08 05:41:08 +00:00
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);
2010-09-30 06:59:00 +00:00
}
2010-10-02 19:01:43 +00:00
var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories);
foreach (var file in filesToDelete)
2010-10-02 19:01:43 +00:00
{
try
{
File.Delete(file);
}
catch { }
2010-10-02 19:01:43 +00:00
}
MockLib.CreateDataBaseTemplate();
2010-09-30 06:59:00 +00:00
}
}