Skip to content

Fix failing assertion message expectations

024ea6a
Select commit
Loading
Failed to load commit list.
Merged

Apply structured assertion messages (RFC 012) to Assert.Fail / Assert.Inconclusive #8296

Fix failing assertion message expectations
024ea6a
Select commit
Loading
Failed to load commit list.
Azure Pipelines / microsoft.testfx (Build Windows Debug) failed May 17, 2026 in 32m 2s

Build Windows Debug failed

Annotations

Check failure on line 218 in test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs

See this annotation in the file changed.

@azure-pipelines azure-pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs#L218

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs(218,1): error : [AreAllDistinct_Generic_WithComparer_HasDuplicate_ShouldFail] [.NET Framework 4.8] Expected exception message to match the equivalent of "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   CaseInsensitiveStringComparer

Assert.AreAllDistinct(new[] { "A", "B", "a" }, <comparer>)", but "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.AssertTests+CaseInsensitiveStringComparer

Assert.AreAllDistinct(new[] { "A", "B", "a" }, <comparer>)" does not.

Check failure on line 271 in test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs

See this annotation in the file changed.

@azure-pipelines azure-pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs#L271

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs(271,1): error : [AreAllDistinct_NonGeneric_WithComparer_HasDuplicate_ShouldFail] [.NET Framework 4.8] Expected exception message to match the equivalent of "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   CaseInsensitiveStringComparer

Assert.AreAllDistinct(list, <comparer>)", but "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.AssertTests+CaseInsensitiveStringComparer

Assert.AreAllDistinct(list, <comparer>)" does not.

Check failure on line 218 in test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs

See this annotation in the file changed.

@azure-pipelines azure-pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs#L218

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs(218,1): error : [AreAllDistinct_Generic_WithComparer_HasDuplicate_ShouldFail] [net8.0] Expected exception message to match the equivalent of "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   CaseInsensitiveStringComparer

Assert.AreAllDistinct(new[] { "A", "B", "a" }, <comparer>)", but "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.AssertTests+CaseInsensitiveStringComparer

Assert.AreAllDistinct(new[] { "A", "B", "a" }, <comparer>)" does not.

Check failure on line 271 in test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs

See this annotation in the file changed.

@azure-pipelines azure-pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs#L271

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs(271,1): error : [AreAllDistinct_NonGeneric_WithComparer_HasDuplicate_ShouldFail] [net8.0] Expected exception message to match the equivalent of "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   CaseInsensitiveStringComparer

Assert.AreAllDistinct(list, <comparer>)", but "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.AssertTests+CaseInsensitiveStringComparer

Assert.AreAllDistinct(list, <comparer>)" does not.

Check failure on line 218 in test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs

See this annotation in the file changed.

@azure-pipelines azure-pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs#L218

test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreAll.cs(218,1): error : [AreAllDistinct_Generic_WithComparer_HasDuplicate_ShouldFail] [net9.0] Expected exception message to match the equivalent of "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   CaseInsensitiveStringComparer

Assert.AreAllDistinct(new[] { "A", "B", "a" }, <comparer>)", but "Assertion failed. Expected all items in collection to be distinct.

duplicates: ["a"]
collection: ["A", "B", "a"]
comparer:   Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.AssertTests+CaseInsensitiveStringComparer

Assert.AreAllDistinct(new[] { "A", "B", "a" }, <comparer>)" does not.