コード例 #1
0
        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:");
        }
コード例 #2
0
        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");
        }
コード例 #3
0
        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();
        }