You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
14 years ago
|
using System;
|
||
|
using System.IO;
|
||
14 years ago
|
using NLog;
|
||
|
using NLog.Config;
|
||
14 years ago
|
using NUnit.Framework;
|
||
14 years ago
|
using NzbDrone.Core.Test.Framework;
|
||
14 years ago
|
|
||
|
namespace NzbDrone.Core.Test
|
||
|
{
|
||
14 years ago
|
[SetUpFixture]
|
||
14 years ago
|
public class Fixtures
|
||
|
{
|
||
|
[TearDown]
|
||
|
public void TearDown()
|
||
|
{
|
||
14 years ago
|
var filesToDelete = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.db", SearchOption.AllDirectories);
|
||
|
foreach (var file in filesToDelete)
|
||
14 years ago
|
{
|
||
|
try
|
||
|
{
|
||
14 years ago
|
File.Delete(file);
|
||
14 years ago
|
}
|
||
14 years ago
|
catch{}
|
||
14 years ago
|
}
|
||
|
}
|
||
14 years ago
|
|
||
|
[SetUp]
|
||
14 years ago
|
public void SetUp()
|
||
14 years ago
|
{
|
||
14 years ago
|
try
|
||
|
{
|
||
14 years ago
|
LogManager.Configuration =
|
||
|
new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
|
||
14 years ago
|
LogManager.ThrowExceptions = true;
|
||
14 years ago
|
|
||
|
var exceptionVerification = new ExceptionVerification();
|
||
|
LogManager.Configuration.AddTarget("ExceptionVerification", exceptionVerification);
|
||
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, exceptionVerification));
|
||
|
LogManager.Configuration.Reload();
|
||
14 years ago
|
}
|
||
|
catch (Exception e)
|
||
|
{
|
||
|
Console.WriteLine("Unable to configure logging. " + e);
|
||
|
}
|
||
14 years ago
|
}
|
||
14 years ago
|
}
|
||
|
}
|