当前位置: 首页>>代码示例>>C#>>正文


C# BuildCommand.GetExecutableExtension方法代码示例

本文整理汇总了C#中Microsoft.DotNet.Tools.Test.Utilities.BuildCommand.GetExecutableExtension方法的典型用法代码示例。如果您正苦于以下问题:C# BuildCommand.GetExecutableExtension方法的具体用法?C# BuildCommand.GetExecutableExtension怎么用?C# BuildCommand.GetExecutableExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.DotNet.Tools.Test.Utilities.BuildCommand的用法示例。


在下文中一共展示了BuildCommand.GetExecutableExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanSetOutputAssemblyNameForApps

        public void CanSetOutputAssemblyNameForApps()
        {
            var testInstance =
                TestAssetsManager
                    .CreateTestInstance("AppWithOutputAssemblyName")
                    .WithLockFiles();

            var root = testInstance.TestRoot;
            var outputDir = Path.Combine(root, "bin");
            var testProject = ProjectUtils.GetProjectJson(root, "AppWithOutputAssemblyName");
            var buildCommand = new BuildCommand(testProject, output: outputDir, framework: DefaultFramework);
            var result = buildCommand.ExecuteWithCapturedOutput();
            result.Should().Pass();

            new DirectoryInfo(outputDir).Should().HaveFiles(
                new [] { "MyApp.dll", "MyApp" + buildCommand.GetExecutableExtension(),
                    "MyApp.runtimeconfig.json", "MyApp.deps.json" });
        }
开发者ID:akrisiun,项目名称:dotnet-cli,代码行数:18,代码来源:CompilerTests.cs

示例2: ContentFilesAreCopied

        public void ContentFilesAreCopied()
        {
            var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithContentPackage")
                                                .WithLockFiles();

            var root = testInstance.TestRoot;

            // run compile
            var outputDir = Path.Combine(root, "bin");
            var testProject = ProjectUtils.GetProjectJson(root, "TestAppWithContentPackage");
            var buildCommand = new BuildCommand(testProject, output: outputDir, framework: DefaultFramework);
            var result = buildCommand.ExecuteWithCapturedOutput();
            result.Should().Pass();

            result = Command.Create(Path.Combine(outputDir, "AppWithContentPackage" + buildCommand.GetExecutableExtension()), new string [0])
                .CaptureStdErr()
                .CaptureStdOut()
                .Execute();
            result.Should().Pass();

            // verify the output xml file
            new DirectoryInfo(outputDir).Sub("scripts").Should()
                .Exist()
                .And.HaveFile("run.cmd");
            new DirectoryInfo(outputDir).Should()
                .HaveFile("config.xml");
            // verify embedded resources
            result.StdOut.Should().Contain("AppWithContentPackage.dnf.png");
            result.StdOut.Should().Contain("AppWithContentPackage.ui.png");
            // verify 'all' language files not included
            result.StdOut.Should().NotContain("AppWithContentPackage.dnf_all.png");
            result.StdOut.Should().NotContain("AppWithContentPackage.ui_all.png");
            // verify classes
            result.StdOut.Should().Contain("AppWithContentPackage.Foo");
            result.StdOut.Should().Contain("MyNamespace.Util");
        }
开发者ID:akrisiun,项目名称:dotnet-cli,代码行数:36,代码来源:CompilerTests.cs


注:本文中的Microsoft.DotNet.Tools.Test.Utilities.BuildCommand.GetExecutableExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。