1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-06 19:12:38 +01:00
Radarr/NzbDrone.Core.Test/Framework/TestBase.cs

46 lines
1.0 KiB
C#
Raw Normal View History

using System.IO;
using NUnit.Framework;
2011-10-24 07:54:09 +02:00
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.Framework
{
public class TestBase
2011-05-22 18:53:21 +02:00
// ReSharper disable InconsistentNaming
{
[SetUp]
2011-10-24 07:54:09 +02:00
public virtual void SetupBase()
{
ExceptionVerification.Reset();
if (Directory.Exists(TempFolder))
{
Directory.Delete(TempFolder, true);
}
2011-10-24 07:54:09 +02:00
Directory.CreateDirectory(TempFolder);
}
[TearDown]
2011-10-24 07:54:09 +02:00
public void TearDownBase()
{
2011-06-02 23:06:46 +02:00
ExceptionVerification.AssertNoUnexcpectedLogs();
}
protected string TempFolder
{
2011-10-24 07:54:09 +02:00
get { return Path.Combine(Directory.GetCurrentDirectory(), "temp"); }
}
protected string GetTestFilePath(string fileName)
{
return Path.Combine(@".\Files\", fileName);
}
protected string ReadTestFile(string fileName)
{
return File.ReadAllText(GetTestFilePath(fileName));
}
}
}