|
2 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
3 | 3 |
|
4 | 4 | using System.IO;
|
| 5 | +using System.Linq; |
5 | 6 | using System.Runtime.InteropServices;
|
6 | 7 | using System.Xml.Linq;
|
7 | 8 | using Microsoft.DotNet.TestFramework;
|
@@ -82,6 +83,51 @@ public void ItCanRunAnAppUsingTheWebSdk()
|
82 | 83 | .Should().Pass().And.HaveStdOutContaining("Hello World!");
|
83 | 84 | }
|
84 | 85 |
|
| 86 | + [WindowsOnlyFact] |
| 87 | + public void ItCanPublishArm64Winforms() |
| 88 | + { |
| 89 | + DirectoryInfo directory = TestAssets.CreateTestDirectory(); |
| 90 | + string projectDirectory = directory.FullName; |
| 91 | + |
| 92 | + string newArgs = "winforms --no-restore"; |
| 93 | + new NewCommandShim() |
| 94 | + .WithWorkingDirectory(projectDirectory) |
| 95 | + .Execute(newArgs) |
| 96 | + .Should().Pass(); |
| 97 | + |
| 98 | + string publishArgs="-r win-arm64"; |
| 99 | + new PublishCommand() |
| 100 | + .WithWorkingDirectory(projectDirectory) |
| 101 | + .Execute(publishArgs) |
| 102 | + .Should().Pass(); |
| 103 | + |
| 104 | + var selfContainedPublishDir = new DirectoryInfo(projectDirectory) |
| 105 | + .Sub("bin").Sub("Debug").GetDirectories().FirstOrDefault() |
| 106 | + .Sub("win-arm64").Sub("publish"); |
| 107 | + |
| 108 | + selfContainedPublishDir.Should().HaveFilesMatching("System.Windows.Forms.dll", SearchOption.TopDirectoryOnly); |
| 109 | + selfContainedPublishDir.Should().HaveFilesMatching($"{directory.Name}.dll", SearchOption.TopDirectoryOnly); |
| 110 | + } |
| 111 | + |
| 112 | + [WindowsOnlyFact] |
| 113 | + public void ItCantPublishArm64Wpf() |
| 114 | + { |
| 115 | + DirectoryInfo directory = TestAssets.CreateTestDirectory(); |
| 116 | + string projectDirectory = directory.FullName; |
| 117 | + |
| 118 | + string newArgs = "wpf --no-restore"; |
| 119 | + new NewCommandShim() |
| 120 | + .WithWorkingDirectory(projectDirectory) |
| 121 | + .Execute(newArgs) |
| 122 | + .Should().Pass(); |
| 123 | + |
| 124 | + string publishArgs="-r win-arm64"; |
| 125 | + new PublishCommand() |
| 126 | + .WithWorkingDirectory(projectDirectory) |
| 127 | + .Execute(publishArgs) |
| 128 | + .Should().Fail(); |
| 129 | + } |
| 130 | + |
85 | 131 | [Theory]
|
86 | 132 | [InlineData("console")]
|
87 | 133 | [InlineData("classlib")]
|
|
0 commit comments