Refactored IntegrationTests to work with Nunit3 VS adapter.

This commit is contained in:
Taloth Saldono 2016-04-04 19:40:51 +02:00
parent 2fa3873503
commit 71ecc96c70
36 changed files with 804 additions and 318 deletions

View file

@ -90,14 +90,11 @@ namespace NzbDrone.Test.Common
[SetUp]
public void TestBaseSetup()
{
GetType().IsPublic.Should().BeTrue("All Test fixtures should be public to work in mono.");
LogManager.ReconfigExistingLoggers();
TempFolder = Path.Combine(Directory.GetCurrentDirectory(), "_temp_" + DateTime.Now.Ticks);
TempFolder = Path.Combine(TestContext.CurrentContext.TestDirectory, "_temp_" + DateTime.Now.Ticks);
Directory.CreateDirectory(TempFolder);
}
@ -152,6 +149,16 @@ namespace NzbDrone.Test.Common
TestFolderInfo = Mocker.GetMock<IAppFolderInfo>().Object;
}
protected string GetTestPath(string path)
{
return Path.Combine(TestContext.CurrentContext.TestDirectory, Path.Combine(path.Split('/')));
}
protected string ReadAllText(string path)
{
return File.ReadAllText(GetTestPath(path));
}
protected string GetTempFilePath()
{
return Path.Combine(TempFolder, Path.GetRandomFileName());