public void CreateFolderTest() { FolderRepository folderRepository = new FolderRepository($@"{Utils.GetSetupDir()}\UploadFolder"); folderRepository.CreateFolder("Folder1", "Bhanu"); Storage input = new Storage { Name = "Bhanu", IsFolder = true }; Assert.IsTrue(folderRepository.Exist("Folder1", input), "Folder not in the list"); //List<Storage> storageList = folderRepository.PopulateStorageList("Folder1"); //bool isPresent = false; //foreach (Storage storage in storageList) //{ // if ((storage.IsFolder) && (storage.Name == "Dutta")) // { // isPresent = true; // break; // } //} //Assert.IsTrue(isPresent, "Dutta is not in the list"); }
public void CreateFileTest() { FolderRepository folderRepository = new FolderRepository($@"{Utils.GetSetupDir()}\UploadFolder"); Stream fileStream = File.OpenRead($@"{Utils.GetSetupDir()}\UploadFolder\file1.txt"); folderRepository.CreateFile("Folder1", fileStream, "Bhanu.txt"); Storage input = new Storage { Name = "Bhanu.txt", IsFolder = false }; Assert.IsTrue(folderRepository.Exist("Folder1", input), "File not in the list"); }