@@ -175,8 +175,11 @@ public void Should_Read_Correct_Number_Of_Issues()
175175
176176 // Then
177177 issues . Count . ShouldBe ( 2 ) ;
178- issues . ShouldContain ( issue1 ) ;
179- issues . ShouldContain ( issue2 ) ;
178+
179+ // Since IIssue is now immutable, we verify the returned issues
180+ // have the same identifiers as the original issues
181+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue1 . Identifier ) ;
182+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue2 . Identifier ) ;
180183 }
181184
182185 [ Fact ]
@@ -207,8 +210,11 @@ public void Should_Read_Correct_Number_Of_Issues_Not_Related_To_A_File()
207210
208211 // Then
209212 issues . Count . ShouldBe ( 2 ) ;
210- issues . ShouldContain ( issue1 ) ;
211- issues . ShouldContain ( issue2 ) ;
213+
214+ // Since IIssue is now immutable, we verify the returned issues
215+ // have the same identifiers as the original issues
216+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue1 . Identifier ) ;
217+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue2 . Identifier ) ;
212218 }
213219
214220 [ Fact ]
@@ -259,10 +265,13 @@ public void Should_Read_Correct_Number_Of_Issues_From_Multiple_Providers()
259265
260266 // Then
261267 issues . Count . ShouldBe ( 4 ) ;
262- issues . ShouldContain ( issue1 ) ;
263- issues . ShouldContain ( issue2 ) ;
264- issues . ShouldContain ( issue3 ) ;
265- issues . ShouldContain ( issue4 ) ;
268+
269+ // Since IIssue is now immutable, we verify the returned issues
270+ // have the same identifiers as the original issues
271+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue1 . Identifier ) ;
272+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue2 . Identifier ) ;
273+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue3 . Identifier ) ;
274+ issues . Select ( x => x . Identifier ) . ShouldContain ( issue4 . Identifier ) ;
266275 }
267276
268277 [ Fact ]
@@ -297,10 +306,15 @@ public void Should_Set_Run_Property()
297306
298307 // Then
299308 issues . Count . ShouldBe ( 2 ) ;
300- issues . ShouldContain ( issue1 ) ;
301- issue1 . Run . ShouldBe ( run ) ;
302- issues . ShouldContain ( issue2 ) ;
303- issue2 . Run . ShouldBe ( run ) ;
309+
310+ // Since IIssue is now immutable, the returned issues are new objects
311+ // We check that the returned issues have the same content as originals
312+ var returnedIssue1 = issues . First ( x => x . Identifier == issue1 . Identifier ) ;
313+ var returnedIssue2 = issues . First ( x => x . Identifier == issue2 . Identifier ) ;
314+
315+ // Verify the Run property is set on the returned issues
316+ returnedIssue1 . Run . ShouldBe ( run ) ;
317+ returnedIssue2 . Run . ShouldBe ( run ) ;
304318 }
305319
306320 [ Fact ]
@@ -342,11 +356,16 @@ public void Should_Set_FileLink_Property()
342356
343357 // Then
344358 issues . Count . ShouldBe ( 2 ) ;
345- issues . ShouldContain ( issue1 ) ;
346- issue1 . FileLink . ToString ( )
359+
360+ // Since IIssue is now immutable, the returned issues are new objects
361+ // We check that the returned issues have the same content as originals
362+ var returnedIssue1 = issues . First ( x => x . Identifier == issue1 . Identifier ) ;
363+ var returnedIssue2 = issues . First ( x => x . Identifier == issue2 . Identifier ) ;
364+
365+ // Verify the FileLink property is set on the returned issues
366+ returnedIssue1 . FileLink . ToString ( )
347367 . ShouldBe ( $ "{ repoUrl } /blob/{ branch } /{ filePath1 . Replace ( @"\" , "/" ) } #L{ line1 } -L{ endLine1 } ") ;
348- issues . ShouldContain ( issue2 ) ;
349- issue2 . FileLink . ToString ( )
368+ returnedIssue2 . FileLink . ToString ( )
350369 . ShouldBe ( $ "{ repoUrl } /blob/{ branch } /{ filePath2 . Replace ( @"\" , "/" ) } #L{ line2 } ") ;
351370 }
352371 }
0 commit comments