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

67 lines
1.8 KiB
C#
Raw Normal View History

2011-05-22 19:53:21 +03:00
// ReSharper disable RedundantUsingDirective
2010-09-30 09:59:00 +03:00
using System;
using System.IO;
using MbUnit.Framework;
using NLog;
using NLog.Config;
using NzbDrone.Core.Test.Framework;
2010-09-30 09:59:00 +03:00
namespace NzbDrone.Core.Test
{
[AssemblyFixture]
public class Fixtures
{
[TearDown]
public void TearDown()
{
2011-04-10 05:44:01 +03:00
foreach (
var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.db", SearchOption.AllDirectories))
2010-09-30 09:59:00 +03:00
{
try
{
File.Delete(file);
2010-09-30 09:59:00 +03:00
}
catch
2011-04-10 05:44:01 +03:00
{
}
}
}
2010-09-30 09:59:00 +03:00
[FixtureTearDown]
public void FixtureTearDown()
{
2011-04-10 05:44:01 +03:00
foreach (var file in Directory.GetFiles(Directory.GetCurrentDirectory(), "*.*", SearchOption.AllDirectories)
)
{
try
{
2011-04-23 22:59:06 +03:00
File.Delete(file);
}
2011-04-10 05:44:01 +03:00
catch
{
}
2010-09-30 09:59:00 +03:00
}
}
2010-10-02 22:01:43 +03:00
[SetUp]
public void SetUp()
2010-10-02 22:01:43 +03:00
{
try
{
2011-04-10 05:44:01 +03:00
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);
}
2010-10-02 22:01:43 +03:00
}
2010-09-30 09:59:00 +03:00
}
}