public void TestExtractFalse() { //Arrange var inMemorySettings = new Dictionary <string, string> { { "Download:DestinationPath", Path.Combine(Directory.GetCurrentDirectory(), @"") }, { "UnZip:ExtractToPathPath", Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\Data\FilesToDigest") }, { "GoogleDriveFiles:Collection", "Collection" }, { "GoogleDriveFiles:ArtistCollection", "ArtistCollection" }, { "GoogleDriveFiles:CollectionMatch", "CollectionMatch" }, { "GoogleDriveFiles:Artist", "Artist" }, }; IConfiguration configuration = new ConfigurationBuilder() .AddInMemoryCollection(inMemorySettings) .Build(); //Act var extractDataService = new DownloadDataService(configuration); //Assert extractDataService.DownloadZipFile().Should().BeFalse("the url are not valid"); }
private void loadData() { messagebox.SelectionStart = 0; messagebox.AppendText("开始下载数据,请稍等.......\n"); DownloadDataService download = new DownloadDataService(); download.DownloadData(this); DownloadIdentifyService service = new DownloadIdentifyService(); ///更新最后一次下载时间 service.UpdateIdentify(DateTime.Now); ///更新亭点收货标识 service.UpdateHarvestFlag(Constant.HARVEST_NO); }