File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
src/libraries/Microsoft.Extensions.DependencyModel/tests Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 11// Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
4- using FluentAssertions ;
4+ using System ;
55using System . IO ;
66using System . Linq ;
7+ using FluentAssertions ;
78using Xunit ;
89
910namespace Microsoft . Extensions . DependencyModel . Tests
@@ -280,13 +281,20 @@ public void MergeMergesRuntimeGraph()
280281 [ SkipOnTargetFramework ( TargetFrameworkMonikers . NetFramework , "GetEntryAssembly() returns null" ) ]
281282 public void DefaultWorksCorrectly ( )
282283 {
283- // only need to assert the context contains non-null properties.
284-
285284 var context = DependencyContext . Default ;
286- Assert . NotNull ( context ) ;
287- Assert . NotNull ( context . RuntimeGraph ) ;
288- Assert . NotNull ( context . RuntimeLibraries ) ;
289- Assert . NotNull ( context . Target ) ;
285+ if ( PlatformDetection . IsSingleFile )
286+ {
287+ // single-file apps return a null default DependencyContext
288+ Assert . Null ( context ) ;
289+ }
290+ else
291+ {
292+ // only need to assert the context contains non-null properties.
293+ Assert . NotNull ( context ) ;
294+ Assert . NotNull ( context . RuntimeGraph ) ;
295+ Assert . NotNull ( context . RuntimeLibraries ) ;
296+ Assert . NotNull ( context . Target ) ;
297+ }
290298 }
291299
292300 private TargetInfo CreateTargetInfo ( )
You can’t perform that action at this time.
0 commit comments