public void ShouldWorkWithFileNodeBackupService()
 {
     var fs = new DryRunFileSystem();
     var driveService = new DryRunDriveService();
     IDownloader downloader = new Downloader(driveService, fs);
     FileNodeBackupService service = new FileNodeBackupService(downloader);
     service.Backup(Utils.MockFileNode("file1", "file1.txt", "text/plain"), "/temp");
     Assert.AreEqual(1, ((DryRunFileBase)fs.File).CreateCount);
 }
 public void ShouldHaveFilesResource()
 {
     var service = new DryRunDriveService();
     Assert.IsNotNull(service.Files);
 }
        public int CountExportFiles(IFileNode fileNode)
        {
            DryRunFileSystem mockFileSystem = new DryRunFileSystem();
            DryRunDriveService mockDriveService = new DryRunDriveService();
            IFileSystem oldFileSystem = FileSystem;
            IDriveService oldDriveService = Downloader.DriveService;
            try
            {
                Downloader.DriveService = mockDriveService;
                Downloader.FileSystem = mockFileSystem;

                Backup(fileNode, null);
                return ((DryRunFileBase)mockFileSystem.File).CreateCount;
            }
            finally
            {
                Downloader.DriveService = oldDriveService;
                Downloader.FileSystem = oldFileSystem;
            }
        }