2010-09-30 08:59:00 +02:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using MbUnit.Framework;
|
2010-10-24 09:46:58 +02:00
|
|
|
using NLog;
|
|
|
|
using NLog.Config;
|
|
|
|
using System.Linq;
|
2010-09-30 08:59:00 +02:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
{
|
|
|
|
[AssemblyFixture]
|
|
|
|
public class Fixtures
|
|
|
|
{
|
|
|
|
[TearDown]
|
|
|
|
public void TearDown()
|
|
|
|
{
|
2010-10-24 09:46:58 +02:00
|
|
|
foreach (var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.db", SearchOption.AllDirectories))
|
2010-09-30 08:59:00 +02:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2010-10-24 09:46:58 +02:00
|
|
|
File.Delete(file);
|
2010-09-30 08:59:00 +02:00
|
|
|
}
|
|
|
|
catch
|
|
|
|
{ }
|
2010-10-24 09:46:58 +02:00
|
|
|
}
|
|
|
|
}
|
2010-09-30 08:59:00 +02:00
|
|
|
|
2010-10-24 09:46:58 +02:00
|
|
|
[FixtureTearDown]
|
|
|
|
public void FixtureTearDown()
|
|
|
|
{
|
|
|
|
foreach (var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.*", SearchOption.AllDirectories))
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
File.Delete(file);
|
|
|
|
}
|
|
|
|
catch { }
|
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
|
|
|
|
{
|
|
|
|
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
Console.WriteLine("Unable to configure logging. " + e);
|
|
|
|
}
|
2010-10-02 21:01:43 +02:00
|
|
|
}
|
2010-10-24 09:46:58 +02:00
|
|
|
|
|
|
|
|
2010-09-30 08:59:00 +02:00
|
|
|
}
|
|
|
|
}
|