File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
test/Microsoft.NET.Build.Tests Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -133,10 +133,30 @@ public void PackageReferences_with_private_assets_do_not_appear_in_deps_file(str
133
133
}
134
134
}
135
135
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
+
136
157
[ WindowsOnlyFact ]
137
158
public void It_can_reference_a_netstandard2_library_and_exchange_types ( )
138
159
{
139
-
140
160
var netStandardLibrary = new TestProject ( )
141
161
{
142
162
Name = "NETStandardLibrary" ,
You can’t perform that action at this time.
0 commit comments