1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-12 11:15:43 +02:00
Sonarr/NzbDrone.Core.Test/Fixtures.cs
2011-05-22 09:53:21 -07:00

67 lines
1.8 KiB
C#

// ReSharper disable RedundantUsingDirective
using System;
using System.IO;
using MbUnit.Framework;
using NLog;
using NLog.Config;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test
{
[AssemblyFixture]
public class Fixtures
{
[TearDown]
public void TearDown()
{
foreach (
var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.db", SearchOption.AllDirectories))
{
try
{
File.Delete(file);
}
catch
{
}
}
}
[FixtureTearDown]
public void FixtureTearDown()
{
foreach (var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.*", SearchOption.AllDirectories)
)
{
try
{
File.Delete(file);
}
catch
{
}
}
}
[SetUp]
public void SetUp()
{
try
{
LogManager.Configuration =
new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"), false);
LogManager.ThrowExceptions = true;
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);
}
}
}
}