public void FolderDelete_ChildFoldersAreDeleted()
        {
            var rootDir  = Path.Combine(new CreateAnImage().BasePath, "test01010");
            var childDir = Path.Combine(new CreateAnImage().BasePath, "test01010", "included-folder");

            var realStorage = new StorageHostFullPathFilesystem();

            realStorage.CreateDirectory(rootDir);
            realStorage.CreateDirectory(childDir);

            realStorage.FolderDelete(rootDir);

            Assert.AreEqual(false, realStorage.ExistFolder(rootDir));
            Assert.AreEqual(false, realStorage.ExistFolder(childDir));
        }
Exemple #2
0
        public async Task MergeJsonFiles_DefaultFile()
        {
            var testDir = Path.Combine(new AppSettings().BaseDirectoryProject, "_test");

            if (_hostStorage.ExistFolder(testDir))
            {
                _hostStorage.FolderDelete(testDir);
            }
            _hostStorage.CreateDirectory(testDir);

            await _hostStorage.WriteStreamAsync(new PlainTextFileHelper().StringToStream(
                                                    "{\n  \"app\": {\n   " +
                                                    " \"StorageFolder\": \"/data/test\"\n " +
                                                    " }\n}\n"), Path.Combine(testDir, "appsettings.json"));

            var result = await SetupAppSettings.MergeJsonFiles(testDir);

            Assert.AreEqual(PathHelper.AddBackslash("/data/test"), result.StorageFolder);
        }