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 ExtractDataService(configuration); //Assert extractDataService.Extract().Should().BeFalse("the path doesn't contain all the necessary files"); }
public void TestTARFilesExistNegative7() { //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(); var googleDriveFiles = configuration.GetSection("GoogleDriveFiles").GetChildren(); var destPath = configuration.GetValue <string>("UnZip:ExtractToPathPath"); //Act var extractDataService = new ExtractDataService(configuration); //Assert extractDataService.CheckIfTARFilesExist(googleDriveFiles, destPath).Should() .Be(true, "the path doesn't contain all the needed files"); }