public void GetDirectoryContents_Given_null_Or_Empty_Returns_Not_Exists() { var provider = new ZipFileProvider(TestData.No_Data_Zip_File); var result = provider.GetDirectoryContents(null); Assert.False(result.Exists, "Says exists."); result = provider.GetDirectoryContents(""); Assert.False(result.Exists, "Says exists."); }
public void GetDirectoryContents_Given_Bad_Folder_Path_Returns_no_exists(string zipData) { var provider = new ZipFileProvider(zipData); var result = provider.GetDirectoryContents("/file"); Assert.False(result.Exists, "Says exists."); result = provider.GetDirectoryContents("/folder/"); Assert.False(result.Exists, "Says exists."); result = provider.GetDirectoryContents("/folder/file"); Assert.False(result.Exists, "Says exists."); }
public void GetDirectoryContents_Given_Non_root_Returns_no_exists() { var provider = new ZipFileProvider(TestData.No_Data_Zip_File); var result = provider.GetDirectoryContents("/file"); Assert.False(result.Exists, "Says exists."); result = provider.GetDirectoryContents("/folder/"); Assert.False(result.Exists, "Says exists."); result = provider.GetDirectoryContents("/folder/file"); Assert.False(result.Exists, "Says exists."); }
public void GetDirectoryContents_Given_Sub_Folder_With_Files_Works(string zipData) { var provider = new ZipFileProvider(zipData); var result = provider.GetDirectoryContents("/folder with files/sub folder"); Assert.True(result.Exists, "Doesn't exists."); Assert.Single(result); }
public void GetDirectoryContents_Given_Top_Folder_Without_Files_Works(string zipData) { var provider = new ZipFileProvider(zipData); var result = provider.GetDirectoryContents("/folder without files"); Assert.True(result.Exists, "Doesn't exists."); Assert.Empty(result); }
public void GetDirectoryContents_Given_Top_Folder_With_Files_Works(string zipData) { var provider = new ZipFileProvider(zipData); var result = provider.GetDirectoryContents("/folder with files"); Assert.True(result.Exists, "Doesn't exists."); Assert.Equal(2, result.Count()); // both file and subfolder }
public void GetDirectoryContents_Given_Root_Exists_With_Files(string zipData) { var provider = new ZipFileProvider(zipData); var result = provider.GetDirectoryContents("/"); Assert.True(result.Exists, "Doesn't exist."); Assert.Equal(4, result.Count()); }
public void GetDirectoryContents_Given_Root_Exists_With_No_Files() { var provider = new ZipFileProvider(TestData.No_Data_Zip_File); var result = provider.GetDirectoryContents("/"); Assert.True(result.Exists, "Doesn't exist."); Assert.Empty(result); }