@@ -147,21 +147,22 @@ public void Constructor_WhenLogLevelIsTrace_ShouldEnableFirstChanceExceptionLogg
147147 }
148148
149149 [ Fact ]
150- public void DebugLogLoaded_WhenSet_ShouldBeRetrievable ( )
150+ public void DebugLogLoaded_WhenSubscribed_ShouldBeInvocable ( )
151151 {
152152 // Arrange
153153 var fileLocationOptions = new FileLocationOptions ( _testDirectory ) ;
154154 var mockSettingsService = CreateMockSettingsService ( LogLevel . Information ) ;
155155
156156 using var debugLogService = new DebugLogService ( fileLocationOptions , mockSettingsService ) ;
157157
158- Action testAction = ( ) => { } ;
158+ var wasInvoked = false ;
159+ debugLogService . DebugLogLoaded += ( ) => wasInvoked = true ;
159160
160161 // Act
161- debugLogService . DebugLogLoaded = testAction ;
162+ debugLogService . LoadDebugLog ( ) ;
162163
163164 // Assert
164- Assert . Same ( testAction , debugLogService . DebugLogLoaded ) ;
165+ Assert . True ( wasInvoked ) ;
165166 }
166167
167168 public void Dispose ( )
@@ -234,22 +235,21 @@ public async Task LoadAsync_WhenLogFileIsEmpty_ShouldReturnNoLines()
234235 }
235236
236237 [ Fact ]
237- public void LoadDebugLog_WhenDebugLogLoadedIsNull_ShouldNotThrow ( )
238+ public void LoadDebugLog_WhenNoSubscribers_ShouldNotThrow ( )
238239 {
239240 // Arrange
240241 var fileLocationOptions = new FileLocationOptions ( _testDirectory ) ;
241242 var mockSettingsService = CreateMockSettingsService ( LogLevel . Information ) ;
242243
243244 using var debugLogService = new DebugLogService ( fileLocationOptions , mockSettingsService ) ;
244- debugLogService . DebugLogLoaded = null ;
245245
246- // Act & Assert
246+ // Act & Assert - no subscribers attached
247247 var exception = Record . Exception ( ( ) => debugLogService . LoadDebugLog ( ) ) ;
248248 Assert . Null ( exception ) ;
249249 }
250250
251251 [ Fact ]
252- public void LoadDebugLog_WhenDebugLogLoadedIsSet_ShouldInvokeAction ( )
252+ public void LoadDebugLog_WhenSubscribed_ShouldInvokeHandler ( )
253253 {
254254 // Arrange
255255 var fileLocationOptions = new FileLocationOptions ( _testDirectory ) ;
@@ -258,7 +258,7 @@ public void LoadDebugLog_WhenDebugLogLoadedIsSet_ShouldInvokeAction()
258258 using var debugLogService = new DebugLogService ( fileLocationOptions , mockSettingsService ) ;
259259
260260 var actionInvoked = false ;
261- debugLogService . DebugLogLoaded = ( ) => actionInvoked = true ;
261+ debugLogService . DebugLogLoaded + = ( ) => actionInvoked = true ;
262262
263263 // Act
264264 debugLogService . LoadDebugLog ( ) ;
0 commit comments