public void SetUp()
        {
            progress = 0;
            args = null;
            Action<int, FileDownloadingEventArgs> reporter = (p, e) =>
            {
                progress = p;
                args = e;
            };
            mockDownloader = new Mock<IDownloader>();
            controller = new BackupProgressController();
            controller.Downloader = mockDownloader.Object;
            controller.Reporter = reporter;

            fileNodes = new IFileNode[]
            {
                Utils.MockFileNode("file1", "file1.txt", "text/plain"),
                Utils.MockFileNode("file2", "file2.txt", "text/plain")
            };

            mockFileNodeBackupService = new Mock<IFileNodeBackupService>();
            mockFileNodeBackupService.Setup(p => p.CountExportFiles(fileNodes[0])).Returns(4);
            mockFileNodeBackupService.Setup(p => p.CountExportFiles(fileNodes[1])).Returns(10);
        }
Esempio n. 2
0
 private void OnDownloading(int progress, FileDownloadingEventArgs e)
 {
     bwDownload.ReportProgress(progress, e);
 }
 private void OnDownloading(object sender, FileDownloadingEventArgs e)
 {
     Progress += Delta;
     Reporter((int)Progress, e);
 }