mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
fixed some broken tests.
This commit is contained in:
parent
b27217bcf4
commit
2f42e7dd83
@ -44,10 +44,10 @@ public void should_delete_sandbox_before_update_if_folder_exists()
|
||||
{
|
||||
Mocker.GetMock<DiskProvider>().Setup(c => c.FolderExists(SANDBOX_FOLDER)).Returns(true);
|
||||
|
||||
|
||||
|
||||
StartUpdate();
|
||||
|
||||
|
||||
|
||||
Mocker.GetMock<DiskProvider>().Verify(c => c.DeleteFolder(SANDBOX_FOLDER, true));
|
||||
}
|
||||
|
||||
@ -56,10 +56,10 @@ public void should_not_delete_sandbox_before_update_if_folder_doesnt_exists()
|
||||
{
|
||||
Mocker.GetMock<DiskProvider>().Setup(c => c.FolderExists(SANDBOX_FOLDER)).Returns(false);
|
||||
|
||||
|
||||
|
||||
StartUpdate();
|
||||
|
||||
|
||||
|
||||
Mocker.GetMock<DiskProvider>().Verify(c => c.DeleteFolder(SANDBOX_FOLDER, true), Times.Never());
|
||||
}
|
||||
|
||||
@ -69,10 +69,10 @@ public void Should_download_update_package()
|
||||
{
|
||||
var updateArchive = Path.Combine(SANDBOX_FOLDER, updatePackage.FileName);
|
||||
|
||||
|
||||
|
||||
StartUpdate();
|
||||
|
||||
|
||||
|
||||
Mocker.GetMock<IHttpProvider>().Verify(
|
||||
c => c.DownloadFile(updatePackage.Url, updateArchive));
|
||||
}
|
||||
@ -82,10 +82,10 @@ public void Should_extract_update_package()
|
||||
{
|
||||
var updateArchive = Path.Combine(SANDBOX_FOLDER, updatePackage.FileName);
|
||||
|
||||
|
||||
|
||||
StartUpdate();
|
||||
|
||||
|
||||
|
||||
Mocker.GetMock<ArchiveProvider>().Verify(
|
||||
c => c.ExtractArchive(updateArchive, SANDBOX_FOLDER));
|
||||
}
|
||||
@ -95,10 +95,10 @@ public void Should_copy_update_client_to_root_of_sandbox()
|
||||
{
|
||||
var updateClientFolder = Mocker.GetMock<EnvironmentProvider>().Object.GetUpdateClientFolder();
|
||||
|
||||
|
||||
|
||||
StartUpdate();
|
||||
|
||||
|
||||
|
||||
Mocker.GetMock<DiskProvider>().Verify(
|
||||
c => c.MoveDirectory(updateClientFolder, SANDBOX_FOLDER));
|
||||
}
|
||||
@ -106,16 +106,16 @@ public void Should_copy_update_client_to_root_of_sandbox()
|
||||
[Test]
|
||||
public void should_start_update_client()
|
||||
{
|
||||
|
||||
|
||||
var updateClientPath = Mocker.GetMock<EnvironmentProvider>().Object.GetUpdateClientExePath();
|
||||
|
||||
Mocker.GetMock<EnvironmentProvider>()
|
||||
.SetupGet(c => c.NzbDroneProcessIdFromEnvironment).Returns(12);
|
||||
|
||||
|
||||
|
||||
StartUpdate();
|
||||
|
||||
|
||||
|
||||
Mocker.GetMock<ProcessProvider>().Verify(
|
||||
c => c.Start(It.Is<ProcessStartInfo>(p =>
|
||||
p.FileName == updateClientPath &&
|
||||
@ -143,15 +143,15 @@ public void Should_download_and_extract_to_temp_folder()
|
||||
var updateSubFolder = new DirectoryInfo(Mocker.GetMock<EnvironmentProvider>().Object.GetUpdateSandboxFolder());
|
||||
|
||||
|
||||
|
||||
|
||||
updateSubFolder.Exists.Should().BeFalse();
|
||||
|
||||
Mocker.Resolve<HttpProvider>();
|
||||
Mocker.SetConstant<IHttpProvider>(new HttpProvider(new EnvironmentProvider()));
|
||||
Mocker.Resolve<DiskProvider>();
|
||||
Mocker.Resolve<ArchiveProvider>();
|
||||
StartUpdate();
|
||||
updateSubFolder.Refresh();
|
||||
|
||||
|
||||
|
||||
updateSubFolder.Exists.Should().BeTrue();
|
||||
updateSubFolder.GetDirectories("nzbdrone").Should().HaveCount(1);
|
||||
|
@ -20,7 +20,7 @@ public class QualityParserFixture : CoreTest
|
||||
new object[] { "WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", Quality.DVD, false },
|
||||
new object[] { "WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", Quality.DVD, false },
|
||||
new object[] { "Two.and.a.Half.Men.S08E05.720p.HDTV.X264-DIMENSION", Quality.HDTV720p, false },
|
||||
new object[] { "this has no extention or periods HDTV", Quality.SDTV, false },
|
||||
new object[] { "Chuck S11E03 has no periods or extention HDTV", Quality.SDTV, false },
|
||||
new object[] { "Chuck.S04E05.HDTV.XviD-LOL", Quality.SDTV, false },
|
||||
new object[] { "The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", Quality.DVD, false },
|
||||
new object[] { "The.Girls.Next.Door.S03E06.DVD.Rip.XviD-WiDE", Quality.DVD, false },
|
||||
@ -41,7 +41,6 @@ public class QualityParserFixture : CoreTest
|
||||
new object[] { "WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", Quality.DVD, false },
|
||||
new object[] { "WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD.avi", Quality.DVD, false },
|
||||
new object[] { "Law & Order: Special Victims Unit - 11x11 - Quickie", Quality.Unknown, false },
|
||||
new object[] { "(<a href=\"http://www.newzbin.com/browse/post/6076286/nzb/\">NZB</a>)", Quality.Unknown, false },
|
||||
new object[] { "S07E23 - [HDTV-720p].mkv ", Quality.HDTV720p, false },
|
||||
new object[] { "S07E23 - [WEBDL].mkv ", Quality.WEBDL720p, false },
|
||||
new object[] { "S07E23.mkv ", Quality.HDTV720p, false },
|
||||
|
@ -23,7 +23,7 @@ public class AppUpdateJob : IJob
|
||||
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public AppUpdateJob(UpdateProvider updateProvider, EnvironmentProvider environmentProvider, DiskProvider diskProvider,
|
||||
HttpProvider httpProvider, ProcessProvider processProvider, ArchiveProvider archiveProvider, ConfigFileProvider configFileProvider)
|
||||
IHttpProvider httpProvider, ProcessProvider processProvider, ArchiveProvider archiveProvider, ConfigFileProvider configFileProvider)
|
||||
{
|
||||
_updateProvider = updateProvider;
|
||||
_environmentProvider = environmentProvider;
|
||||
|
@ -116,7 +116,7 @@ public string BuildFilename(IList<Episode> episodes, Series series, EpisodeFile
|
||||
|
||||
if (nameSpec.AppendQuality)
|
||||
{
|
||||
result += String.Format(" [{0}]", episodeFile.Quality);
|
||||
result += String.Format(" [{0}]", episodeFile.Quality.Quality);
|
||||
|
||||
if (episodeFile.Quality.Proper)
|
||||
result += " [Proper]";
|
||||
|
Loading…
Reference in New Issue
Block a user