@@ -459,13 +459,12 @@ public void ExportDeviceListShouldUseCommaDelimiterNotSemicolon()
459459 using var reader = new StreamReader ( fileStream ) ;
460460 var content = reader . ReadToEnd ( ) ;
461461
462- // Assert - Should contain commas as delimiters, not semicolons
463- _ = content . Should ( ) . Contain ( "," , "CSV should use comma delimiter" ) ;
464- _ = content . Should ( ) . NotContain ( ";" , "CSV should not use semicolon delimiter" ) ;
465-
466- // Verify that header fields are properly comma-separated
462+ // Assert - Verify header is comma-separated by parsing it
467463 var lines = content . Split ( new [ ] { "\r \n " , "\n " } , StringSplitOptions . RemoveEmptyEntries ) ;
468464 var headerFields = lines [ 0 ] . Split ( ',' ) ;
465+
466+ // Should be able to parse the header with comma delimiter
467+ _ = headerFields . Length . Should ( ) . BeGreaterThan ( 1 , "CSV header should have multiple comma-separated fields" ) ;
469468 _ = headerFields . Should ( ) . Contain ( "Id" ) ;
470469 _ = headerFields . Should ( ) . Contain ( "Name" ) ;
471470 _ = headerFields . Should ( ) . Contain ( "ModelId" ) ;
@@ -496,12 +495,12 @@ public void ExportTemplateFileShouldUseCommaDelimiterNotSemicolon()
496495 using var reader = new StreamReader ( fileStream ) ;
497496 var content = reader . ReadToEnd ( ) ;
498497
499- // Assert - Should contain commas as delimiters, not semicolons
500- _ = content . Should ( ) . Contain ( ", ", "CSV template should use comma delimiter" ) ;
501- _ = content . Should ( ) . NotContain ( ";" , "CSV template should not use semicolon delimiter" ) ;
502-
503- // Verify that header fields are properly comma-separated
504- var headerFields = content . TrimEnd ( ) . Split ( ',' ) ;
498+ // Assert - Verify header is comma-separated by parsing it
499+ var lines = content . Split ( new [ ] { " \r \n ", "\n " } , StringSplitOptions . RemoveEmptyEntries ) ;
500+ var headerFields = lines [ 0 ] . Split ( ',' ) ;
501+
502+ // Should be able to parse the header with comma delimiter
503+ _ = headerFields . Length . Should ( ) . BeGreaterThan ( 1 , "CSV template header should have multiple comma-separated fields" ) ;
505504 _ = headerFields . Should ( ) . Contain ( "Id" ) ;
506505 _ = headerFields . Should ( ) . Contain ( "Name" ) ;
507506 _ = headerFields . Should ( ) . Contain ( "ModelId" ) ;
0 commit comments