public async Task WithUnknownOutputDir_RunAsync_LogsFailure() { var outputDir = $"TMP{DateTime.Now:HHmmssFFF}"; var manifest = TestManifestBuilder .From("http://localhost:19080") .WithTempDir(outputDir) .Build(); var command = new CleanLocalPackagesCommand( new CommandContext { Manifest = manifest, Logger = Logger.Object }); await command.RunAsync(); ShouldContainsLogMessage("Local folder has failed with error:"); }
public async Task WithOutputDir_RunAsync_LogsSuccess() { var outputDir = await CreateDirectoryAsync(); var manifest = TestManifestBuilder .From("http://localhost:19080") .WithTempDir(outputDir) .Build(); var command = new CleanLocalPackagesCommand( new CommandContext { Manifest = manifest, Logger = Logger.Object }); await command.RunAsync(); ShouldContainsLogMessage("Local folder has been cleaned"); }
public async Task WithOutputDir_RunAsync_DeletesFolder() { var outputDir = await CreateDirectoryAsync(); var manifest = TestManifestBuilder .From("http://localhost:19080") .WithTempDir(outputDir) .Build(); var command = new CleanLocalPackagesCommand( new CommandContext { Manifest = manifest, Logger = Logger.Object }); await command.RunAsync(); Directory.Exists(outputDir).ShouldBeFalse(); }