Skip to content

Commit 181689f

Browse files
committed
e2e test
1 parent 6a09c4c commit 181689f

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopLibrary.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,30 @@ public void PackageReferences_with_private_assets_do_not_appear_in_deps_file(str
133133
}
134134
}
135135

136+
[Fact]
137+
public void PackageWithoutAssets_ShouldNotShowUpInDepsJson()
138+
{
139+
var testProject = new TestProject()
140+
{
141+
TargetFrameworks = ToolsetInfo.CurrentTargetFramework
142+
};
143+
testProject.PackageReferences.Add(new TestPackageReference("Nerdbank.GitVersioning", "3.6.146"));
144+
145+
var testAsset = _testAssetsManager.CreateTestProject(testProject);
146+
147+
var buildCommand = new BuildCommand(testAsset);
148+
buildCommand.Execute().Should().Pass();
149+
150+
using (var depsJsonFileStream = File.OpenRead(Path.Combine(buildCommand.GetOutputDirectory("net9.0").FullName, "PackageWithoutAssets_ShouldNotShowUpInDepsJson.deps.json")))
151+
{
152+
var dependencyContext = new DependencyContextJsonReader().Read(depsJsonFileStream);
153+
dependencyContext.RuntimeLibraries.Any(l => l.Name.Equals("Nerdbank.GitVersioning")).Should().BeFalse();
154+
}
155+
}
156+
136157
[WindowsOnlyFact]
137158
public void It_can_reference_a_netstandard2_library_and_exchange_types()
138159
{
139-
140160
var netStandardLibrary = new TestProject()
141161
{
142162
Name = "NETStandardLibrary",

0 commit comments

Comments
 (0)