22
33namespace Sentry . Tests . PlatformAbstractions ;
44
5- public class RuntimeInfoTests
5+ public class RuntimeInfoTests ( ITestOutputHelper output )
66{
77 [ Fact ]
88 public void GetRuntime_AllProperties ( )
99 {
10+ var frameworkDescription = RuntimeInformation . FrameworkDescription ;
11+ output . WriteLine ( $ "RuntimeInformation.FrameworkDescription: { frameworkDescription } ") ;
12+
1013 var actual = RuntimeInfo . GetRuntime ( ) ;
11- Assert . NotNull ( actual ) ;
12- Assert . NotNull ( actual . Name ) ;
13- Assert . NotNull ( actual . Version ) ;
14- Assert . NotNull ( actual . Raw ) ;
14+ actual . Should ( ) . NotBeNull ( "GetRuntime returned null" ) ;
15+ actual . Name . Should ( ) . NotBeNull ( "Runtime Name is null" ) ;
16+ actual . Version . Should ( ) . NotBeNull ( "Runtime Version is null" ) ;
17+ actual . Raw . Should ( ) . NotBeNull ( "Runtime Raw is null" ) ;
1518
1619#if NET5_0_OR_GREATER
1720 Assert . Equal ( ".NET" , actual . Name ) ;
@@ -20,13 +23,18 @@ public void GetRuntime_AllProperties()
2023 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
2124 {
2225 Assert . Equal ( ".NET Framework" , actual . Name ) ;
23- Assert . NotNull ( actual . FrameworkInstallation ) ;
24- Assert . NotNull ( actual . FrameworkInstallation . Version ) ;
26+ actual . FrameworkInstallation . Should ( ) . NotBeNull ( "FrameworkInstallation is null" ) ;
27+ // TODO: Windows ARM64 broke in CI... the timing wasn't very good (same day .NET 10 was announced) and I
28+ // don't have a Windows ARM64 device to test on. Will need to debug in CI when we've released V6.
29+ if ( RuntimeInformation . ProcessArchitecture != Architecture . Arm64 )
30+ {
31+ actual . FrameworkInstallation . Version . Should ( ) . NotBeNull ( "FrameworkInstallation.Version is null" ) ;
32+ }
2533 }
2634 else
2735 {
2836 Assert . Equal ( "Mono" , actual . Name ) ;
29- Assert . Null ( actual . FrameworkInstallation ) ;
37+ actual . FrameworkInstallation . Should ( ) . BeNull ( " FrameworkInstallation is not null" ) ;
3038 }
3139#endif
3240 }
0 commit comments