コード例 #1
0
        public void StandaloneAppHasResourceDependency()
        {
            // WindowsAzure.Services brings in en, zh etc. resource DLLs.
            // The host has to be able to find these assemblies from the deps file
            // from the standalone app base under the ietf tag directory.

            var          testName = "TestAppWithResourceDeps";
            TestInstance instance =
                TestAssetsManager
                .CreateTestInstance(testName)
                .WithLockFiles()
                .WithBuildArtifacts();

            var publishCommand = new PublishCommand(instance.TestRoot);

            publishCommand.Execute().Should().Pass();

            var publishedDir = publishCommand.GetOutputDirectory();
            var extension    = publishCommand.GetExecutableExtension();
            var outputExe    = testName + extension;

            publishedDir.Should().HaveFiles(new[] { $"{testName}.dll", outputExe });

            var command = new TestCommand(Path.Combine(publishedDir.FullName, outputExe));

            command.Execute("").Should().ExitWith(0);
        }
コード例 #2
0
ファイル: PublishTests.cs プロジェクト: nguyentthai96/cli
        public void PublishAppWithOutputAssemblyName()
        {
            TestInstance instance =
                TestAssetsManager
                .CreateTestInstance("AppWithOutputAssemblyName")
                .WithLockFiles()
                .WithBuildArtifacts();

            var testRoot       = _getProjectJson(instance.TestRoot, "AppWithOutputAssemblyName");
            var publishCommand = new PublishCommand(testRoot, output: testRoot);

            publishCommand.Execute().Should().Pass();

            var publishedDir = publishCommand.GetOutputDirectory();
            var extension    = publishCommand.GetExecutableExtension();
            var outputExe    = "MyApp" + extension;

            publishedDir.Should().HaveFiles(new[] { "MyApp.dll", outputExe });
            publishedDir.Should().NotHaveFile("AppWithOutputAssemblyName" + extension);
            publishedDir.Should().NotHaveFile("AppWithOutputAssemblyName.dll");

            var command = new TestCommand(Path.Combine(publishedDir.FullName, outputExe));

            command.Execute("").Should().ExitWith(0);
        }
コード例 #3
0
        public void PublishTestAppWithContentPackage()
        {
            var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithContentPackage")
                               .WithLockFiles();

            var publishCommand = new PublishCommand(testInstance.TestRoot);
            var publishResult  = publishCommand.Execute();

            publishResult.Should().Pass();

            var publishDir = publishCommand.GetOutputDirectory(portable: false);

            publishDir.Should().HaveFiles(new[]
            {
                $"AppWithContentPackage{publishCommand.GetExecutableExtension()}",
                "AppWithContentPackage.dll",
                "AppWithContentPackage.deps.json"
            });

            // these files come from the contentFiles of the SharedContentA dependency
            publishDir
            .Sub("scripts")
            .Should()
            .Exist()
            .And
            .HaveFile("run.cmd");

            publishDir
            .Should()
            .HaveFile("config.xml");
        }