public IDownloadViewModel CreateDownloadViewModel(Download download, IDownloadSlotsViewModel downloadSlotsViewModel) { DownloadViewModel downloadViewModel = new DownloadViewModel(download, downloadSlotsViewModel, fileSystemManager); return downloadViewModel; }
protected override void Establish_context() { base.Establish_context(); DownloadSlotsViewModel = new Mock<IDownloadSlotsViewModel>(); Download = new Mock<IDownloadModel>(); Download.SetupGet(download => download.SaveFolderPath).Returns(savingFolder); Download.SetupGet(download => download.FileName).Returns(savingFileName); Download.SetupSet(download => download.State = It.IsAny<DownloadState>()). Callback<DownloadState>(state => LastSettingState = state); FileSystemManager = new Mock<IFileSystemManager>(); DownloadViewModel = new DownloadViewModel(Download.Object, DownloadSlotsViewModel.Object, FileSystemManager.Object); SavePath = System.IO.Path.Combine(savingFolder, savingFileName); }