예제 #1
0
        private MockDownloadJob GetJob_FailedDownload_NetFailed(string songHash, string songDir)
        {
            Exception        downloadException = new WebClientException("404: Not Found");
            DownloadResult   downloadResult    = new DownloadResult(@"C:\Test", DownloadResultStatus.NetFailed, 404, "404: Not Found", downloadException);
            ZipExtractResult zipResult         = null;
            var finalResult = new JobResult()
            {
                SongHash = songHash, DownloadResult = downloadResult, ZipResult = zipResult, SongDirectory = songDir
            };
            var job = new MockDownloadJob(songHash, finalResult);

            return(job);
        }
예제 #2
0
        private MockDownloadJob GetJob_FailedDownload_IOFailed(string songHash, string songDir)
        {
            Exception        downloadException = new IOException();
            DownloadResult   downloadResult    = new DownloadResult(@"C:\Test", DownloadResultStatus.IOFailed, 200, "IOFailed", downloadException);
            ZipExtractResult zipResult         = null;
            var finalResult = new JobResult()
            {
                SongHash = songHash, DownloadResult = downloadResult, ZipResult = zipResult, SongDirectory = songDir
            };
            var job = new MockDownloadJob(songHash, finalResult);

            return(job);
        }
예제 #3
0
        private MockDownloadJob GetJob_Successful(string songHash, string songDir)
        {
            var downloadResult = new DownloadResult(@"C:\Test", DownloadResultStatus.Success, 200);
            var zipResult      = new ZipExtractResult()
            {
                ResultStatus = ZipExtractResultStatus.Success
            };
            var finalResult = new JobResult()
            {
                SongHash = songHash, DownloadResult = downloadResult, ZipResult = zipResult, SongDirectory = songDir
            };
            var job = new MockDownloadJob(songHash, finalResult);

            return(job);
        }
예제 #4
0
        private MockDownloadJob GetJob_FailedExtraction_Source(string songHash, string songDir)
        {
            var       downloadResult = new DownloadResult(@"C:\Test", DownloadResultStatus.Success, 200);
            Exception zipException   = new IOException();
            var       zipResult      = new ZipExtractResult()
            {
                ResultStatus = ZipExtractResultStatus.SourceFailed, Exception = zipException
            };
            var finalResult = new JobResult()
            {
                SongHash = songHash, DownloadResult = downloadResult, ZipResult = zipResult, SongDirectory = null
            };
            var job = new MockDownloadJob(songHash, finalResult);

            return(job);
        }