@@ -186,6 +186,7 @@ public void UpdateHighlightGroups_PopulatesComboBox ()
186186 _controller . UpdateHighlightGroups ( groups , "Errors" ) ;
187187
188188 var combo = _toolbar . Items [ "highlightGroupsToolStripComboBox" ] as ToolStripComboBox ;
189+ Assert . That ( combo , Is . Not . Null ) ;
189190 Assert . That ( combo . Items , Has . Count . EqualTo ( 3 ) ) ;
190191 Assert . That ( combo . Text , Is . EqualTo ( "Errors" ) ) ;
191192 }
@@ -229,6 +230,7 @@ public void HighlightGroupSelected_RaisesEvent_OnComboChange ()
229230
230231 // Simulate user selecting "Errors"
231232 var combo = _toolbar . Items [ "highlightGroupsToolStripComboBox" ] as ToolStripComboBox ;
233+ Assert . That ( combo , Is . Not . Null , "Expected highlightGroupsToolStripComboBox to be a ToolStripComboBox." ) ;
232234 combo . SelectedIndex = 1 ; // This triggers SelectedIndexChanged
233235
234236 Assert . That ( selectedGroup , Is . EqualTo ( "Errors" ) ) ;
@@ -247,6 +249,7 @@ public void Dispose_UnsubscribesEvents ()
247249
248250 // Changing selection after dispose should not raise HighlightGroupSelected
249251 var combo = _toolbar . Items [ "highlightGroupsToolStripComboBox" ] as ToolStripComboBox ;
252+ Assert . That ( combo , Is . Not . Null , "Expected highlightGroupsToolStripComboBox to be a ToolStripComboBox." ) ;
250253 combo . SelectedIndex = 0 ;
251254
252255 Assert . That ( selectedGroup , Is . Null ) ;
@@ -325,6 +328,7 @@ public void UpdateGuiState_SetsBookmarkBubblesButton ()
325328 _controller . UpdateGuiState ( state , false ) ;
326329
327330 var bubblesButton = _toolbar . Items [ "toolStripButtonBubbles" ] as ToolStripButton ;
331+ Assert . That ( bubblesButton , Is . Not . Null , "Expected toolStripButtonBubbles to be a ToolStripButton." ) ;
328332 Assert . That ( bubblesButton . Checked , Is . True ) ;
329333 }
330334
0 commit comments