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