2010-09-30 06:59:00 +00:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using MbUnit.Framework;
|
2010-10-24 07:46:58 +00:00
|
|
|
using NLog;
|
|
|
|
using NLog.Config;
|
2010-09-30 06:59:00 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
{
|
|
|
|
[AssemblyFixture]
|
|
|
|
public class Fixtures
|
|
|
|
{
|
|
|
|
[TearDown]
|
|
|
|
public void TearDown()
|
|
|
|
{
|
2011-04-10 02:44:01 +00:00
|
|
|
foreach (
|
|
|
|
var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.db", SearchOption.AllDirectories))
|
2010-09-30 06:59:00 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2010-10-24 07:46:58 +00:00
|
|
|
File.Delete(file);
|
2010-09-30 06:59:00 +00:00
|
|
|
}
|
|
|
|
catch
|
2011-04-10 02:44:01 +00:00
|
|
|
{
|
|
|
|
}
|
2010-10-24 07:46:58 +00:00
|
|
|
}
|
|
|
|
}
|
2010-09-30 06:59:00 +00:00
|
|
|
|
2010-10-24 07:46:58 +00:00
|
|
|
[FixtureTearDown]
|
|
|
|
public void FixtureTearDown()
|
|
|
|
{
|
2011-04-10 02:44:01 +00:00
|
|
|
foreach (var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.*", SearchOption.AllDirectories)
|
|
|
|
)
|
2010-10-24 07:46:58 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2011-04-23 19:59:06 +00:00
|
|
|
|
2010-10-24 07:46:58 +00:00
|
|
|
File.Delete(file);
|
|
|
|
}
|
2011-04-10 02:44:01 +00:00
|
|
|
catch
|
|
|
|
{
|
|
|
|
}
|
2010-09-30 06:59:00 +00:00
|
|
|
}
|
|
|
|
}
|
2010-10-02 19:01:43 +00:00
|
|
|
|
|
|
|
[SetUp]
|
2010-10-24 07:46:58 +00:00
|
|
|
public void SetUp()
|
2010-10-02 19:01:43 +00:00
|
|
|
{
|
2010-10-24 07:46:58 +00:00
|
|
|
try
|
|
|
|
{
|
2011-04-10 02:44:01 +00:00
|
|
|
LogManager.Configuration =
|
|
|
|
new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
|
2010-10-30 02:46:32 +00:00
|
|
|
LogManager.ThrowExceptions = true;
|
2010-10-24 07:46:58 +00:00
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
Console.WriteLine("Unable to configure logging. " + e);
|
|
|
|
}
|
2010-10-02 19:01:43 +00:00
|
|
|
}
|
2010-09-30 06:59:00 +00:00
|
|
|
}
|
|
|
|
}
|