async Task WriteNugetConfigToWorkingDirectoryAsync() { const string nugetConfigXml = @"<?xml version=""1.0"" encoding=""utf-8""?><configuration><packageSources><add key=""nuget.org"" value=""https://api.nuget.org/v3/index.json"" /></packageSources><activePackageSource><add key=""All"" value=""(Aggregate source)"" /></activePackageSource> </configuration>"; var dstFilename = _snapFilesystem.PathCombine(_baseFixture.WorkingDirectory, "nuget.config"); await _snapFilesystem.FileWriteUtf8StringAsync(nugetConfigXml, dstFilename, CancellationToken.None); }
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)); }