@@ -32,7 +32,7 @@ public async Task CsvWriter_WriteToCsv_ShouldGenerateExpectedOutput_NamelessObje
3232 string csvContent = csvWriter . ParseToString ( data ) ;
3333
3434 // Assert
35- await Assert . That ( csvContent . Trim ( ) ) . IsEqualTo ( expectedOutput ) ;
35+ await Assert . That ( csvContent ) . IsEqualTo ( expectedOutput ) . IgnoringWhitespace ( ) ;
3636 }
3737
3838 [ Test ]
@@ -60,7 +60,7 @@ public async Task CsvWriter_WriteToCsvAsync_ShouldGenerateExpectedOutput_Nameles
6060 string csvContent = await csvWriter . ParseToStringAsync ( data ) ;
6161
6262 // Assert
63- await Assert . That ( csvContent . Trim ( ) ) . IsEqualTo ( expectedOutput ) ;
63+ await Assert . That ( csvContent ) . IsEqualTo ( expectedOutput ) . IgnoringWhitespace ( ) ;
6464 }
6565 #endregion
6666
@@ -88,7 +88,7 @@ public async Task CsvWriter_WriteToCsv_ShouldGenerateExpectedOutput_ClassWithout
8888 string csvContent = csvWriter . ParseToString ( data ) ;
8989
9090 // Assert
91- await Assert . That ( csvContent . Trim ( ) ) . IsEqualTo ( expectedOutput ) ;
91+ await Assert . That ( csvContent ) . IsEqualTo ( expectedOutput ) . IgnoringWhitespace ( ) ;
9292 }
9393
9494 [ Test ]
@@ -99,7 +99,7 @@ public async Task CsvWriter_WriteToCsvAsync_ShouldGenerateExpectedOutput_ClassWi
9999 new ( ) { Name = "Jane" , Age = 25 }
100100 ] ;
101101
102- CsvParser ? csvWriter = CsvParser . FromConfig ( config => {
102+ CsvParser csvWriter = CsvParser . FromConfig ( config => {
103103 config . ColumnSplit = ";" ;
104104 config . UseLowerCaseHeaders = true ;
105105 } ) ;
@@ -114,7 +114,7 @@ public async Task CsvWriter_WriteToCsvAsync_ShouldGenerateExpectedOutput_ClassWi
114114 string csvContent = await csvWriter . ParseToStringAsync ( data ) ;
115115
116116 // Assert
117- await Assert . That ( csvContent . Trim ( ) ) . IsEqualTo ( expectedOutput ) ;
117+ await Assert . That ( csvContent ) . IsEqualTo ( expectedOutput ) . IgnoringWhitespace ( ) ;
118118 }
119119 #endregion
120120
@@ -142,7 +142,7 @@ public async Task CsvWriter_WriteToCsv_ShouldGenerateExpectedOutput_Class() {
142142 string csvContent = csvWriter . ParseToString ( data ) ;
143143
144144 // Assert
145- await Assert . That ( csvContent . Trim ( ) ) . IsEqualTo ( expectedOutput ) ;
145+ await Assert . That ( csvContent ) . IsEqualTo ( expectedOutput ) . IgnoringWhitespace ( ) ;
146146 }
147147
148148 [ Test ]
@@ -153,7 +153,7 @@ public async Task CsvWriter_WriteToCsvAsync_ShouldGenerateExpectedOutput_Class()
153153 new ( ) { UserName = "Jane" , UserAge = 25 }
154154 ] ;
155155
156- CsvParser ? csvWriter = CsvParser . FromConfig ( config => {
156+ CsvParser csvWriter = CsvParser . FromConfig ( config => {
157157 config . ColumnSplit = ";" ;
158158 config . UseLowerCaseHeaders = true ;
159159 } ) ;
@@ -168,7 +168,7 @@ public async Task CsvWriter_WriteToCsvAsync_ShouldGenerateExpectedOutput_Class()
168168 string csvContent = await csvWriter . ParseToStringAsync ( data ) ;
169169
170170 // Assert
171- await Assert . That ( csvContent . Trim ( ) ) . IsEqualTo ( expectedOutput ) ;
171+ await Assert . That ( csvContent ) . IsEqualTo ( expectedOutput ) . IgnoringWhitespace ( ) ;
172172 }
173173 #endregion
174174}
0 commit comments