Ejemplo n.º 1
0
        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.");
        }
Ejemplo n.º 2
0
        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.");
        }
Ejemplo n.º 3
0
        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.");
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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
        }
Ejemplo n.º 7
0
        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());
        }
Ejemplo n.º 8
0
        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);
        }