本文整理汇总了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" });
}
示例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");
}