diff --git a/docs/RFCs/012-Structured-Assertion-Messages.md b/docs/RFCs/012-Structured-Assertion-Messages.md index 3e3c898a98..b504dff883 100644 --- a/docs/RFCs/012-Structured-Assertion-Messages.md +++ b/docs/RFCs/012-Structured-Assertion-Messages.md @@ -1,7 +1,7 @@ # RFC 012 - Structured Assertion Messages - [x] Approved in principle -- [ ] Under discussion +- [x] Under discussion - [x] Implementation - [ ] Shipped diff --git a/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx b/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx index 7260259912..2ec92dbcc7 100644 --- a/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx +++ b/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx @@ -522,7 +522,7 @@ Actual: {2} Expected strings to be equal. - Expected values to not be equal. + Expected values to differ. Expected strings to differ (case-insensitive). @@ -540,10 +540,10 @@ Actual: {2} Expected all items in collection to be of the specified type. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. Expected collection to contain all specified items. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf index 20f1cad4be..128c18e3c8 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Skutečnost: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Skutečnost: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf index cfdb8d2a41..cce50f3d54 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Tatsächlich: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Tatsächlich: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf index 83bb0cd433..ed215a08e4 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Real: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Real: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf index 4ca1a56046..7774288f73 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Réel : {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Réel : {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf index 1238a340b1..260b26a1aa 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Effettivo: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Effettivo: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf index dd0342f802..f2c2a592f9 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Actual: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Actual: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf index 01f11d4c25..dbe051c089 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Actual: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Actual: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf index 1e31eed0aa..afcbdef50c 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Rzeczywiste: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Rzeczywiste: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf index ddf1c49b7c..be2038cda6 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Real: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Real: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf index e868a010d0..e9bf463114 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Actual: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Actual: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf index f570186b4a..bb1b4b56c0 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Gerçekte olan: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Gerçekte olan: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf index 600907e9c4..04e12b94e1 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Actual: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Actual: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf index 9a091de149..1e46436117 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf @@ -454,8 +454,8 @@ - Expected string to not match the specified regular expression. - Expected string to not match the specified regular expression. + Expected string to not match the specified pattern. + Expected string to not match the specified pattern. @@ -633,8 +633,8 @@ Actual: {2} - Expected values to not be equal. - Expected values to not be equal. + Expected values to differ. + Expected values to differ. @@ -668,8 +668,8 @@ Actual: {2} - Expected string to match the specified regular expression. - Expected string to match the specified regular expression. + Expected string to match the specified pattern. + Expected string to match the specified pattern. diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs b/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs index ade608bf67..94287e4c2f 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs +++ b/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs @@ -362,7 +362,7 @@ public void AreNotEqual_FailsWithStructuredMessage() action.Should().Throw() .Which.Message.Should().Be( """ - Assertion failed. Expected values to not be equal. + Assertion failed. Expected values to differ. notExpected: 0 actual: 0 @@ -503,7 +503,7 @@ public async Task GenericAreNotEqual_InterpolatedString_SameValues_ShouldFail() (await action.Should().ThrowAsync()) .Which.Message.Should().Be( $""" - Assertion failed. Expected values to not be equal. + Assertion failed. Expected values to differ. User-provided message. DummyClassTrackingToStringCalls, DummyClassTrackingToStringCalls, Hello, DummyIFormattable.ToString(), {string.Format(null, "{0:tt}", dateTime)}, {string.Format(null, "{0,5:tt}", dateTime)} notExpected: 0 diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs b/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs index c2bee0fd0f..0bb846f337 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs +++ b/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs @@ -24,7 +24,7 @@ public void MatchesRegex_WithRegexPattern_OnFailure_UsesStructuredMessageAndPayl AssertFailedException ex = action.Should().Throw() .WithMessage( """ - Assertion failed. Expected string to match the specified regular expression. + Assertion failed. Expected string to match the specified pattern. User-provided message expected pattern: "^foo" @@ -49,7 +49,7 @@ public void MatchesRegex_WithStringPattern_OnFailure_UsesStructuredMessage() action.Should().Throw() .WithMessage( """ - Assertion failed. Expected string to match the specified regular expression. + Assertion failed. Expected string to match the specified pattern. expected pattern: "^foo" actual: "hello" @@ -73,7 +73,7 @@ public void DoesNotMatchRegex_WithRegexPattern_OnFailure_UsesStructuredMessageAn AssertFailedException ex = action.Should().Throw() .WithMessage( """ - Assertion failed. Expected string to not match the specified regular expression. + Assertion failed. Expected string to not match the specified pattern. User-provided message unexpected pattern: "world" @@ -98,7 +98,7 @@ public void DoesNotMatchRegex_WithStringPattern_OnFailure_UsesStructuredMessage( action.Should().Throw() .WithMessage( """ - Assertion failed. Expected string to not match the specified regular expression. + Assertion failed. Expected string to not match the specified pattern. unexpected pattern: "world" actual: "hello world"