Skip to content

Commit

Permalink
Enable xUnit2029 rule (#10600)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-alizada authored Sep 3, 2024
1 parent d424254 commit 7cf6609
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,11 @@ dotnet_diagnostic.xUnit1012.severity = warning
# Use Assert.Fail() instead of Assert.True(false) or Assert.False(true)
dotnet_diagnostic.xUnit2020.severity = warning

# Use Assert.DoesNotContain instead of Assert.Empty on filtered collections
dotnet_diagnostic.xUnit2029.severity = warning

# xunit to supress temp
dotnet_diagnostic.xUnit1031.severity = none
dotnet_diagnostic.xUnit2029.severity = none

# Do not use equality check to check for collection size.
dotnet_diagnostic.xUnit2013.severity = none
2 changes: 1 addition & 1 deletion src/Tasks.UnitTests/GetSDKReference_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public void VerifyCacheFileNames()
// References from the two builds should not overlap, otherwise the cache files are being misused
foreach (var ref2 in references2)
{
Assert.Empty(references1.Where(i => i.ItemSpec.Equals(ref2.ItemSpec, StringComparison.InvariantCultureIgnoreCase)));
Assert.DoesNotContain(references1, i => i.ItemSpec.Equals(ref2.ItemSpec, StringComparison.InvariantCultureIgnoreCase));
}

Thread.Sleep(100);
Expand Down

0 comments on commit 7cf6609

Please sign in to comment.