11using Microsoft . CodeAnalysis ;
22using Microsoft . VisualStudio . TestTools . UnitTesting ;
3- using System . Reflection ;
43
54namespace FluentAssertions . BestPractices . Tests
65{
@@ -257,7 +256,7 @@ public class CollectionTests
257256 newAssertion : "actual.Should().ContainSingle(x => x.BooleanProperty{0});" ) ]
258257 [ Implemented ]
259258 public void CollectionShouldContainSingleProperty_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldContainSinglePropertyCodeFix , CollectionShouldContainSinglePropertyAnalyzer > ( oldAssertion , newAssertion ) ;
260-
259+
261260 [ AssertionDataTestMethod ]
262261 [ AssertionDiagnostic ( "actual.Should().NotBeNull().And.NotBeEmpty({0});" ) ]
263262 [ NotImplemented ]
@@ -301,7 +300,7 @@ public class CollectionTests
301300 newAssertion : "actual.Should().HaveElementAt(6, expectedItem{0});" ) ]
302301 [ Implemented ]
303302 public void CollectionShouldHaveElementAt_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldHaveElementAtCodeFix , CollectionShouldHaveElementAtAnalyzer > ( oldAssertion , newAssertion ) ;
304-
303+
305304 [ AssertionDataTestMethod ]
306305 [ AssertionDiagnostic ( "actual.OrderBy(x => x.BooleanProperty).Should().Equal(actual{0});" ) ]
307306 [ Implemented ]
@@ -340,57 +339,62 @@ public class CollectionTests
340339
341340 [ AssertionDataTestMethod ]
342341 [ AssertionDiagnostic ( "actual.Intersect(expected).Should().BeEmpty({0});" ) ]
343- [ NotImplemented ]
342+ [ Implemented ]
344343 public void CollectionShouldNotIntersectWith_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldNotIntersectWithAnalyzer > ( assertion ) ;
345344
346345 [ AssertionDataTestMethod ]
347346 [ AssertionCodeFix (
348347 oldAssertion : "actual.Intersect(expected).Should().BeEmpty({0});" ,
349348 newAssertion : "actual.Should().NotIntersectWith(expected{0});" ) ]
350- [ NotImplemented ]
349+ [ Implemented ]
351350 public void CollectionShouldNotIntersectWith_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldNotIntersectWithCodeFix , CollectionShouldNotIntersectWithAnalyzer > ( oldAssertion , newAssertion ) ;
351+
352352 [ AssertionDataTestMethod ]
353353 [ AssertionDiagnostic ( "actual.Intersect(expected).Should().NotBeEmpty({0});" ) ]
354- [ NotImplemented ]
354+ [ Implemented ]
355355 public void CollectionShouldIntersectWith_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldIntersectWithAnalyzer > ( assertion ) ;
356356
357357 [ AssertionDataTestMethod ]
358358 [ AssertionCodeFix (
359- oldAssertion : "actual.Intersect(expected).Should().NotBeEmpty({0});" ,
360- newAssertion : "actual.Should().IntersectWith(expected{0});" ) ]
361- [ NotImplemented ]
359+ oldAssertion : "actual.Intersect(expected).Should().NotBeEmpty({0});" ,
360+ newAssertion : "actual.Should().IntersectWith(expected{0});" ) ]
361+ [ Implemented ]
362362 public void CollectionShouldIntersectWith_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldIntersectWithCodeFix , CollectionShouldIntersectWithAnalyzer > ( oldAssertion , newAssertion ) ;
363+
363364 [ AssertionDataTestMethod ]
364365 [ AssertionDiagnostic ( "actual.Select(x => x.BooleanProperty).Should().NotContainNulls({0});" ) ]
365- [ NotImplemented ]
366+ [ Implemented ]
366367 public void CollectionShouldNotContainNulls_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldNotContainNullsAnalyzer > ( assertion ) ;
367368
368369 [ AssertionDataTestMethod ]
369370 [ AssertionCodeFix (
370- oldAssertion : "actual.Select(x => x.BooleanProperty).Should().NotContainNulls({0});" ,
371- newAssertion : "actual.Should().NotContainNulls(e => e.OtherProperty{0});" ) ]
372- [ NotImplemented ]
371+ oldAssertion : "actual.Select(x => x.BooleanProperty).Should().NotContainNulls({0});" ,
372+ newAssertion : "actual.Should().NotContainNulls(x => x.BooleanProperty{0});" ) ]
373+ [ Implemented ]
374+ [ Ignore ( "Will be available in Fluent Assertions 5.0" ) ]
373375 public void CollectionShouldNotContainNulls_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldNotContainNullsCodeFix , CollectionShouldNotContainNullsAnalyzer > ( oldAssertion , newAssertion ) ;
376+
374377 [ AssertionDataTestMethod ]
375378 [ AssertionDiagnostic ( "actual.Should().HaveSameCount(actual.Distinct(){0});" ) ]
376379 [ NotImplemented ]
377380 public void CollectionShouldOnlyHaveUniqueItems_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldOnlyHaveUniqueItemsAnalyzer > ( assertion ) ;
378381
379382 [ AssertionDataTestMethod ]
380383 [ AssertionCodeFix (
381- oldAssertion : "actual.Should().HaveSameCount(actual.Distinct(){0});" ,
382- newAssertion : "actual.Should().OnlyHaveUniqueItems({0});" ) ]
384+ oldAssertion : "actual.Should().HaveSameCount(actual.Distinct(){0});" ,
385+ newAssertion : "actual.Should().OnlyHaveUniqueItems({0});" ) ]
383386 [ NotImplemented ]
384387 public void CollectionShouldOnlyHaveUniqueItems_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldOnlyHaveUniqueItemsCodeFix , CollectionShouldOnlyHaveUniqueItemsAnalyzer > ( oldAssertion , newAssertion ) ;
388+
385389 [ AssertionDataTestMethod ]
386390 [ AssertionDiagnostic ( "actual.Select(x => x.BooleanProperty).Should().OnlyHaveUniqueItems({0});" ) ]
387391 [ NotImplemented ]
388392 public void CollectionShouldOnlyHaveUniqueItemsByComparer_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < CollectionShouldOnlyHaveUniqueItemsByComparerAnalyzer > ( assertion ) ;
389393
390394 [ AssertionDataTestMethod ]
391395 [ AssertionCodeFix (
392- oldAssertion : "actual.Select(x => x.BooleanProperty).Should().OnlyHaveUniqueItems({0});" ,
393- newAssertion : "actual.Should().OnlyHaveUniqueItems(x => x.BooleanProperty{0});" ) ]
396+ oldAssertion : "actual.Select(x => x.BooleanProperty).Should().OnlyHaveUniqueItems({0});" ,
397+ newAssertion : "actual.Should().OnlyHaveUniqueItems(x => x.BooleanProperty{0});" ) ]
394398 [ NotImplemented ]
395399 public void CollectionShouldOnlyHaveUniqueItemsByComparer_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldOnlyHaveUniqueItemsByComparerCodeFix , CollectionShouldOnlyHaveUniqueItemsByComparerAnalyzer > ( oldAssertion , newAssertion ) ;
396400 [ AssertionDataTestMethod ]
@@ -400,8 +404,8 @@ public class CollectionTests
400404
401405 [ AssertionDataTestMethod ]
402406 [ AssertionCodeFix (
403- oldAssertion : "actual.FirstOrDefault().Should().BeNull({0});" ,
404- newAssertion : "actual.Should().HaveElementAt(0, null{0});" ) ]
407+ oldAssertion : "actual.FirstOrDefault().Should().BeNull({0});" ,
408+ newAssertion : "actual.Should().HaveElementAt(0, null{0});" ) ]
405409 [ NotImplemented ]
406410 public void CollectionShouldHaveElementAt0Null_TestCodeFix ( string oldAssertion , string newAssertion ) => VerifyCSharpFix < CollectionShouldHaveElementAt0NullCodeFix , CollectionShouldHaveElementAt0NullAnalyzer > ( oldAssertion , newAssertion ) ;
407411
0 commit comments