Skip to content

Commit f2ccb58

Browse files
authored
Attempt to Fix and Re-enable HasIncludedFiles Test (#47220)
2 parents 8166b99 + 2ecd7d4 commit f2ccb58

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>$(CurrentTargetFramework)</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<None Update="packfiles\pack1.txt" Pack="true" PackagePath="newpath/pack1.txt" />
12+
<None Update="packfiles\pack2.txt" Pack="true" PackagePath="anotherpath/pack2.txt" />
13+
</ItemGroup>
14+
15+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// See https://aka.ms/new-console-template for more information
2+
Console.WriteLine("Hello, World!");

test/TestAssets/TestProjects/EndToEndTestApp/packfiles/pack1.txt

Whitespace-only changes.

test/TestAssets/TestProjects/EndToEndTestApp/packfiles/pack2.txt

Whitespace-only changes.

test/dotnet-pack.Tests/PackTests.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ public void SettingVersionSuffixFlag_ShouldStampAssemblyInfoInOutputAssemblyAndP
8080
outputPackage.Should().Exist();
8181
}
8282

83-
[Fact(Skip = "Test project missing")]
83+
[Fact]
8484
public void HasIncludedFiles()
8585
{
8686
var testInstance = _testAssetsManager.CopyTestAsset("EndToEndTestApp")
8787
.WithSource();
8888

8989
new DotnetPackCommand(Log)
9090
.WithWorkingDirectory(testInstance.Path)
91-
.Execute()
91+
.Execute("-c", "Debug")
9292
.Should().Pass();
9393

9494
var outputPackage = new FileInfo(Path.Combine(testInstance.Path,
@@ -99,8 +99,7 @@ public void HasIncludedFiles()
9999

100100
ZipFile.Open(outputPackage.FullName, ZipArchiveMode.Read)
101101
.Entries
102-
.Should().Contain(e => e.FullName == "packfiles/pack1.txt")
103-
.And.Contain(e => e.FullName == "newpath/pack2.txt")
102+
.Should().Contain(e => e.FullName == "newpath/pack1.txt")
104103
.And.Contain(e => e.FullName == "anotherpath/pack2.txt");
105104
}
106105

0 commit comments

Comments
 (0)