예제 #1
0
        public async Task SinglePackageInManifest_RunAsync_CopiesAppToTargetFolder()
        {
            using var outputDir = new TempOutputDir();
            var manifest = TestManifestBuilder
                           .From("http://localhost:19080")
                           .WithTempDir(outputDir.TempDir)
                           .WithGroup(new DeploymentItem
            {
                PackagePath = Path.Combine(TestInfo.OutputDir, "Support", "Packages", "App1")
            })
                           .Build();
            var command = new CopyPackagesLocallyCommand(
                new CommandContext {
                Manifest = manifest, Logger = Logger.Object
            }, InnerCommand.Object);

            await command.RunAsync();

            DirectoryExists(outputDir.TempDir, "App1");
            FileExists(outputDir.TempDir, "App1", "ApplicationManifest.xml");
            DirectoryExists(outputDir.TempDir, "App1", "StatusServicePkg");
            FileExists(outputDir.TempDir, "App1", "StatusServicePkg", "ServiceManifest.xml");
            DirectoryExists(outputDir.TempDir, "App1", "StatusServicePkg", "Code");
            FileExists(outputDir.TempDir, "App1", "StatusServicePkg", "Code", "StatusService.dll");
            FileExists(outputDir.TempDir, "App1", "StatusServicePkg", "Code", "StatusService.exe");
            FileExists(outputDir.TempDir, "App1", "StatusServicePkg", "Code", "StatusService.pdb");
            DirectoryExists(outputDir.TempDir, "App1", "StatusServicePkg", "Config");
            FileExists(outputDir.TempDir, "App1", "StatusServicePkg", "Config", "Settings.xml");
        }
예제 #2
0
        public async Task NoErrors_RunAsync_CallsInnerCommandRunAsync()
        {
            using var outputDir = new TempOutputDir();
            var manifest = TestManifestBuilder
                           .From("http://localhost:19080")
                           .WithTempDir(outputDir.TempDir)
                           .WithGroup(new DeploymentItem
            {
                PackagePath = Path.Combine(TestInfo.OutputDir, "Support", "Packages", "App1")
            })
                           .Build();
            var command = new CopyPackagesLocallyCommand(
                new CommandContext {
                Manifest = manifest, Logger = Logger.Object
            }, InnerCommand.Object);

            await command.RunAsync();

            InnerCommand.Verify(c => c.RunAsync(), Times.Once);
        }