@@ -63,9 +63,10 @@ public async Task GetHealthAsync_ShouldIncludeMetadata_WhenFileSystemIsAccessibl
6363
6464 // Assert
6565 health . Metadata . Should ( ) . NotBeNull ( "metadata should be provided" ) ;
66+ health . Metadata ! . Should ( ) . NotBeNull ( "metadata should be provided" ) ;
6667
6768 // If there was a file locking error (e.g., from concurrent test runs), skip the rest
68- if ( health . Metadata . ContainsKey ( "Error" ) )
69+ if ( health . Metadata ! . ContainsKey ( "Error" ) )
6970 {
7071 // File locking can occur in test scenarios - this is acceptable
7172 health . Metadata . Should ( ) . ContainKey ( "SettingsPath" , "error metadata should include settings path" ) ;
@@ -127,9 +128,9 @@ public async Task GetHealthAsync_ShouldReportFileCount_WhenSettingsDirectoryHasF
127128
128129 // Assert
129130 health . Metadata . Should ( ) . ContainKey ( "FileCount" ) ;
130- var fileCount = health . Metadata [ "FileCount" ] ;
131+ var fileCount = health . Metadata ! [ "FileCount" ] ;
131132 fileCount . Should ( ) . BeOfType < int > ( "file count should be an integer" ) ;
132- ( ( int ) fileCount ) . Should ( ) . BeGreaterThanOrEqualTo ( 0 , "file count should not be negative" ) ;
133+ ( ( int ) fileCount ! ) . Should ( ) . BeGreaterThanOrEqualTo ( 0 , "file count should not be negative" ) ;
133134 }
134135
135136 /// <summary>
@@ -149,12 +150,12 @@ public async Task GetHealthAsync_ShouldReportMultipleFiles_InProductionEnvironme
149150
150151 // Assert
151152 health . IsHealthy . Should ( ) . BeTrue ( "production environment should be healthy" ) ;
152- var fileCount = ( int ) health . Metadata [ "FileCount" ] ;
153+ var fileCount = ( int ) health . Metadata ! [ "FileCount" ] ! ;
153154 fileCount . Should ( ) . BeGreaterThan ( 0 , "settings directory should contain configuration files" ) ;
154155
155156 // Validate typical configuration files exist
156157 health . Metadata . Should ( ) . ContainKey ( "LastModified" ) ;
157- health . Metadata [ "LastModified" ] . Should ( ) . NotBeNull ( "should report last modification time" ) ;
158+ health . Metadata ! [ "LastModified" ] . Should ( ) . NotBeNull ( "should report last modification time" ) ;
158159 }
159160
160161 [ Fact ]
0 commit comments