diff --git a/.editorconfig b/.editorconfig index 16eb28996b6..c86ef1981e6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 \ No newline at end of file diff --git a/src/Tasks.UnitTests/GetSDKReference_Tests.cs b/src/Tasks.UnitTests/GetSDKReference_Tests.cs index 851300230cd..db7e1f155f1 100644 --- a/src/Tasks.UnitTests/GetSDKReference_Tests.cs +++ b/src/Tasks.UnitTests/GetSDKReference_Tests.cs @@ -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);