2010-09-30 08:59:00 +02:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
2010-10-24 09:46:58 +02:00
|
|
|
using NLog;
|
|
|
|
using NLog.Config;
|
2011-06-02 23:06:46 +02:00
|
|
|
using NUnit.Framework;
|
2011-05-19 05:55:35 +02:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
2010-09-30 08:59:00 +02:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
{
|
2011-06-02 23:06:46 +02:00
|
|
|
[SetUpFixture]
|
2010-09-30 08:59:00 +02:00
|
|
|
public class Fixtures
|
|
|
|
{
|
|
|
|
[TearDown]
|
|
|
|
public void TearDown()
|
|
|
|
{
|
2011-07-08 07:41:08 +02:00
|
|
|
|
2010-09-30 08:59:00 +02:00
|
|
|
}
|
2010-10-02 21:01:43 +02:00
|
|
|
|
|
|
|
[SetUp]
|
2010-10-24 09:46:58 +02:00
|
|
|
public void SetUp()
|
2010-10-02 21:01:43 +02:00
|
|
|
{
|
2010-10-24 09:46:58 +02:00
|
|
|
try
|
|
|
|
{
|
2011-10-17 04:03:54 +02:00
|
|
|
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
|
2010-10-30 04:46:32 +02:00
|
|
|
LogManager.ThrowExceptions = true;
|
2011-05-19 05:55:35 +02:00
|
|
|
|
|
|
|
var exceptionVerification = new ExceptionVerification();
|
|
|
|
LogManager.Configuration.AddTarget("ExceptionVerification", exceptionVerification);
|
|
|
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, exceptionVerification));
|
|
|
|
LogManager.Configuration.Reload();
|
2010-10-24 09:46:58 +02:00
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
Console.WriteLine("Unable to configure logging. " + e);
|
|
|
|
}
|
2011-07-08 07:41:08 +02:00
|
|
|
|
|
|
|
var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sdf", SearchOption.AllDirectories);
|
|
|
|
foreach (var file in filesToDelete)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
File.Delete(file);
|
|
|
|
}
|
|
|
|
catch { }
|
|
|
|
}
|
2011-10-17 04:03:54 +02:00
|
|
|
|
|
|
|
MockLib.CreateDataBaseTemplate();
|
2010-10-02 21:01:43 +02:00
|
|
|
}
|
2010-09-30 08:59:00 +02:00
|
|
|
}
|
|
|
|
}
|