Skip to content

Commit f48c150

Browse files
committed
add a test so we don't regress
1 parent 1ded2b7 commit f48c150

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
#nullable disable
5+
6+
using System.Runtime.CompilerServices;
7+
using Microsoft.DotNet.Cli.Utils;
8+
9+
namespace Microsoft.NET.Publish.Tests
10+
{
11+
public class GivenThatWeWantToPublishAToolProject : SdkTest
12+
{
13+
public GivenThatWeWantToPublishAToolProject(ITestOutputHelper log) : base(log)
14+
{
15+
}
16+
17+
private TestAsset SetupTestAsset([CallerMemberName] string callingMethod = "")
18+
{
19+
TestAsset helloWorldAsset = _testAssetsManager
20+
.CopyTestAsset("PortableTool", callingMethod)
21+
.WithSource();
22+
23+
24+
return helloWorldAsset;
25+
}
26+
27+
[Fact]
28+
// this test verifies that we don't regress the 'normal' publish experience accidentally in the
29+
// PackTool.targets
30+
public void It_can_publish_and_has_apphost()
31+
{
32+
var testAsset = SetupTestAsset();
33+
var publishCommand = new PublishCommand(testAsset);
34+
35+
publishCommand.Execute();
36+
37+
publishCommand.GetOutputDirectory(targetFramework: ToolsetInfo.CurrentTargetFramework)
38+
.EnumerateFiles().Should().Contain(f => f.Name == "consoledemo" + Constants.ExeSuffix);
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)