Beispiel #1
0
        public async Task TestDirectoryDeleteAsync()
        {
            await using var tmpDir = _baseFixture.WithDisposableTempDirectory(_snapFilesystem);
            var rootDirectory = _snapFilesystem.PathCombine(tmpDir.WorkingDirectory, "rootDirectory");

            _snapFilesystem.DirectoryCreate(rootDirectory);

            var subDirectory = _snapFilesystem.PathCombine(rootDirectory, "subDirectory");

            _snapFilesystem.DirectoryCreate(subDirectory);

            var testFile = _snapFilesystem.PathCombine(subDirectory, "mytEstFile.txt");
            await _snapFilesystem.FileWriteUtf8StringAsync("yolo", testFile, default);

            await _snapFilesystem.DirectoryDeleteAsync(rootDirectory);

            Assert.False(_snapFilesystem.DirectoryExists(rootDirectory));
        }
Beispiel #2
0
 public void Dispose()
 {
     _filesystem.DirectoryDeleteAsync(WorkingDirectory).GetAwaiter().GetResult();
 }
Beispiel #3
0
 public async ValueTask DisposeAsync()
 {
     await _filesystem.DirectoryDeleteAsync(WorkingDirectory);
 }