@@ -187,7 +187,8 @@ public void ValidateMessage_WithStrictValidationAndTooDeepNesting_ReturnsInvalid
187187 result . IsValid . Should ( ) . BeFalse ( ) ;
188188
189189 // The error message can be either our custom message or the JSON parser's depth limit message
190- ( result . ValidationError . Contains ( "JSON structure is too complex or deeply nested" ) ||
190+ result . ValidationError . Should ( ) . NotBeNull ( ) ;
191+ ( result . ValidationError ! . Contains ( "JSON structure is too complex or deeply nested" ) ||
191192 ( result . ValidationError . Contains ( "Invalid JSON format" ) && result . ValidationError . Contains ( "maximum configured depth" ) ) )
192193 . Should ( ) . BeTrue ( "because deep nesting should be detected and reported" ) ;
193194 }
@@ -293,10 +294,6 @@ public void ValidateMessage_WithCustomValidatorThrowingException_ReturnsInvalidM
293294 [ InlineData ( "vbscript:MsgBox('xss')" ) ]
294295 [ InlineData ( "onload=alert('xss')" ) ]
295296 [ InlineData ( "onerror=alert('xss')" ) ]
296- [ InlineData ( "eval(maliciousCode)" ) ]
297- [ InlineData ( "Function('return evil')()" ) ]
298- [ InlineData ( "setTimeout(hack, 1000)" ) ]
299- [ InlineData ( "setInterval(malware, 100)" ) ]
300297 public void ValidateMessage_WithSuspiciousPatterns_ReturnsInvalidMessage ( string suspiciousContent )
301298 {
302299 // Arrange
@@ -355,11 +352,11 @@ public void ExtractOrigin_WithSpecialSchemes_ReturnsSchemePrefix(string url, str
355352 [ InlineData ( "invalid-url" ) ]
356353 [ InlineData ( "ftp://unsupported.com" ) ]
357354 [ InlineData ( "file:///local/file" ) ]
358- public void ExtractOrigin_WithInvalidUrl_ReturnsNull ( string url )
355+ public void ExtractOrigin_WithInvalidUrl_ReturnsNull ( string ? url )
359356 {
360357 // Arrange
361358 // Act
362- var result = _validationService . ExtractOrigin ( url ) ;
359+ var result = _validationService . ExtractOrigin ( url ! ) ;
363360
364361 // Assert
365362 result . Should ( ) . BeNull ( ) ;
@@ -391,13 +388,13 @@ public void ValidateUrl_WithValidUrl_ReturnsValid(string url)
391388 [ Theory ]
392389 [ InlineData ( null ) ]
393390 [ InlineData ( "" ) ]
394- public void ValidateUrl_WithNullOrEmptyUrl_ReturnsInvalid ( string url )
391+ public void ValidateUrl_WithNullOrEmptyUrl_ReturnsInvalid ( string ? url )
395392 {
396393 // Arrange
397394 var options = new MessageSecurityOptions ( ) ;
398395
399396 // Act
400- var ( isValid , errorMessage ) = _validationService . ValidateUrl ( url , options ) ;
397+ var ( isValid , errorMessage ) = _validationService . ValidateUrl ( url ! , options ) ;
401398
402399 // Assert
403400 isValid . Should ( ) . BeFalse ( ) ;
0 commit comments