Example #1
0
        public void SubsequentInstantiationsCreatesDifferentTemporaryStorageDirectoriesThatExists()
        {
            TemporaryStorageManager storageManager1 = new TemporaryStorageManager();
            TemporaryStorageManager storageManager2 = new TemporaryStorageManager();

            storageManager1.TemporaryDirectoryPath.Should().NotBe(storageManager2.TemporaryDirectoryPath);
            Directory.Exists(storageManager1.TemporaryDirectoryPath).Should().BeTrue();
            Directory.Exists(storageManager2.TemporaryDirectoryPath).Should().BeTrue();
        }
Example #2
0
        public void CreateFilePathAppendsGivenFileNameToTemporaryDirectory()
        {
            TemporaryStorageManager storageManager = new TemporaryStorageManager();
            string fileName         = "myfile.txt";
            string expectedFilePath = Path.Combine(storageManager.TemporaryDirectoryPath, fileName);

            string filePath = storageManager.CreateFilePath(fileName);

            filePath.Should().Be(expectedFilePath);
        }
Example #3
0
        public void CopyFolderContentsToTemporaryDirectoryShouldCopyFolderContent()
        {
            TemporaryStorageManager storageManager = new TemporaryStorageManager();
            string sourcePath = CreateTemporaryFiles();

            string[] sourceFiles = GetFileNames(sourcePath);

            storageManager.CopyFolderContentsToTemporaryDirectory(sourcePath);

            string[] targetFiles = GetFileNames(storageManager.TemporaryDirectoryPath);
            targetFiles.Should().BeEquivalentTo(sourceFiles);
        }