mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
Updated tests to work better with VS2013 Test Adapter.
This commit is contained in:
parent
388943ea1b
commit
79b2b14668
11 changed files with 121 additions and 112 deletions
|
@ -109,9 +109,15 @@ namespace NzbDrone.Test.Common
|
|||
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(TempFolder))
|
||||
var tempFolder = new DirectoryInfo(TempFolder);
|
||||
if (tempFolder.Exists)
|
||||
{
|
||||
Directory.Delete(TempFolder, true);
|
||||
foreach (var file in tempFolder.GetFiles("*", SearchOption.AllDirectories))
|
||||
{
|
||||
file.IsReadOnly = false;
|
||||
}
|
||||
|
||||
tempFolder.Delete(true);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
@ -119,7 +125,6 @@ namespace NzbDrone.Test.Common
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
protected IAppFolderInfo TestFolderInfo { get; private set; }
|
||||
|
||||
protected void WindowsOnly()
|
||||
|
@ -148,26 +153,11 @@ namespace NzbDrone.Test.Common
|
|||
TestFolderInfo = Mocker.GetMock<IAppFolderInfo>().Object;
|
||||
}
|
||||
|
||||
protected string GetTestFilePath(string fileName)
|
||||
protected string GetTempFilePath()
|
||||
{
|
||||
return Path.Combine(SandboxFolder, fileName);
|
||||
return Path.Combine(TempFolder, Path.GetRandomFileName());
|
||||
}
|
||||
|
||||
protected string GetTestFilePath()
|
||||
{
|
||||
return GetTestFilePath(Path.GetRandomFileName());
|
||||
}
|
||||
|
||||
protected string SandboxFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
var folder = Path.Combine(Directory.GetCurrentDirectory(), "Files");
|
||||
Directory.CreateDirectory(folder);
|
||||
return folder;
|
||||
}
|
||||
|
||||
}
|
||||
protected void VerifyEventPublished<TEvent>() where TEvent : class, IEvent
|
||||
{
|
||||
VerifyEventPublished<TEvent>(Times.Once());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue