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