Organized tests for DiskScan and PostDownload

Added tests for GetVideoFiles and ProcessVideoFile
This commit is contained in:
Mark McDowall 2012-08-29 08:34:51 -07:00
commit cc6011ec87
16 changed files with 921 additions and 433 deletions

View file

@ -42,6 +42,14 @@ namespace NzbDrone.Common
.Max(c => c.LastWriteTimeUtc);
}
public virtual DateTime GetLastFileWrite(string path)
{
if (!FileExists(path))
throw new FileNotFoundException("File doesn't exist: " + path);
return new FileInfo(path).LastWriteTimeUtc;
}
public virtual bool FolderExists(string path)
{
return Directory.Exists(path);
@ -209,5 +217,13 @@ namespace NzbDrone.Common
{
return String.Equals(firstPath.NormalizePath(), secondPath.NormalizePath(), StringComparison.InvariantCultureIgnoreCase);
}
public virtual long GetFileSize(string path)
{
if (!FileExists(path))
throw new FileNotFoundException("File doesn't exist: " + path);
return new FileInfo(path).Length;
}
}
}