diff --git a/src/TestFramework/TestFramework/Assertions/Assert.Matches.cs b/src/TestFramework/TestFramework/Assertions/Assert.Matches.cs index c36ff1ef52..09db0ae990 100644 --- a/src/TestFramework/TestFramework/Assertions/Assert.Matches.cs +++ b/src/TestFramework/TestFramework/Assertions/Assert.Matches.cs @@ -46,12 +46,28 @@ public static void MatchesRegex([NotNull] Regex? pattern, [NotNull] string? valu if (!pattern.IsMatch(value)) { - string userMessage = BuildUserMessageForPatternExpressionAndValueExpression(message, patternExpression, valueExpression); - string finalMessage = string.Format(CultureInfo.CurrentCulture, FrameworkMessages.IsMatchFail, value, pattern, userMessage); - ReportAssertFailed("Assert.MatchesRegex", finalMessage); + ReportAssertMatchesRegexFailed(pattern, value, message, patternExpression, valueExpression); } } + [DoesNotReturn] + private static void ReportAssertMatchesRegexFailed(Regex pattern, string value, string? userMessage, string patternExpression, string valueExpression) + { + string patternText = AssertionValueRenderer.RenderValue(pattern.ToString()); + string actualText = AssertionValueRenderer.RenderValue(value); + EvidenceBlock evidence = EvidenceBlock.Create() + .AddLine("expected pattern:", patternText) + .AddLine("actual:", actualText); + + StructuredAssertionMessage structured = new(FrameworkMessages.MatchesRegexFailedSummary); + structured.WithUserMessage(userMessage); + structured.WithEvidence(evidence); + structured.WithExpectedAndActual(patternText, actualText); + structured.WithCallSiteExpression(FormatCallSiteExpression("Assert.MatchesRegex", patternExpression, valueExpression, "", "")); + + ReportAssertFailed(structured); + } + /// /// Tests whether the specified string MatchesRegex a regular expression and /// throws an exception if the string does not match the expression. @@ -124,12 +140,28 @@ public static void DoesNotMatchRegex([NotNull] Regex? pattern, [NotNull] string? if (pattern.IsMatch(value)) { - string userMessage = BuildUserMessageForPatternExpressionAndValueExpression(message, patternExpression, valueExpression); - string finalMessage = string.Format(CultureInfo.CurrentCulture, FrameworkMessages.IsNotMatchFail, value, pattern, userMessage); - ReportAssertFailed("Assert.DoesNotMatchRegex", finalMessage); + ReportAssertDoesNotMatchRegexFailed(pattern, value, message, patternExpression, valueExpression); } } + [DoesNotReturn] + private static void ReportAssertDoesNotMatchRegexFailed(Regex pattern, string value, string? userMessage, string patternExpression, string valueExpression) + { + string patternText = AssertionValueRenderer.RenderValue(pattern.ToString()); + string actualText = AssertionValueRenderer.RenderValue(value); + EvidenceBlock evidence = EvidenceBlock.Create() + .AddLine("unexpected pattern:", patternText) + .AddLine("actual:", actualText); + + StructuredAssertionMessage structured = new(FrameworkMessages.DoesNotMatchRegexFailedSummary); + structured.WithUserMessage(userMessage); + structured.WithEvidence(evidence); + structured.WithExpectedAndActual(patternText, actualText); + structured.WithCallSiteExpression(FormatCallSiteExpression("Assert.DoesNotMatchRegex", patternExpression, valueExpression, "", "")); + + ReportAssertFailed(structured); + } + /// /// Tests whether the specified string does not match a regular expression /// and throws an exception if the string MatchesRegex the expression. diff --git a/src/TestFramework/TestFramework/Assertions/Assert.cs b/src/TestFramework/TestFramework/Assertions/Assert.cs index 6a46f4a88f..b3c20de7f0 100644 --- a/src/TestFramework/TestFramework/Assertions/Assert.cs +++ b/src/TestFramework/TestFramework/Assertions/Assert.cs @@ -275,9 +275,6 @@ private static string BuildUserMessageForTwoExpressions(string? format, string c private static string BuildUserMessageForCollectionExpression(string? format, string collectionExpression) => BuildUserMessageForSingleExpression(format, collectionExpression, "collection"); - private static string BuildUserMessageForPatternExpressionAndValueExpression(string? format, string patternExpression, string valueExpression) - => BuildUserMessageForTwoExpressions(format, patternExpression, "pattern", valueExpression, "value"); - private static string BuildUserMessageForExpectedExpressionAndActualExpression(string? format, string expectedExpression, string actualExpression) => BuildUserMessageForTwoExpressions(format, expectedExpression, "expected", actualExpression, "actual"); diff --git a/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx b/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx index 4c06871944..dd9fc1b561 100644 --- a/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx +++ b/src/TestFramework/TestFramework/Resources/FrameworkMessages.resx @@ -479,6 +479,12 @@ Actual: {2} Expected value to not be null. + + Expected string to match the specified regular expression. + + + Expected string to not match the specified regular expression. + Expected collection to contain exactly one element. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf index 2d91e4afc7..59ccc4447e 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf @@ -68,6 +68,111 @@ Očekávaná délka řetězce je {0}, ale byla {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Nebyla očekávána žádná hodnota kromě:<{1}>. Aktuálně:<{2}>. {0} @@ -78,6 +183,26 @@ Očekáván rozdíl, který je větší jak <{3}> mezi očekávanou hodnotou <{1}> a aktuální hodnotou <{2}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Obě hodnoty jsou <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} Řetězec „{0}“ začíná řetězcem „{1}“. {2} @@ -329,7 +459,7 @@ Skutečnost: {2} Expected condition to be false. - Očekávala se podmínka false. + Expected condition to be false. @@ -409,12 +539,12 @@ Skutečnost: {2} Expected value to not be null. - Očekávaná hodnota nesmí být null. + Expected value to not be null. Expected value to be null. - Očekávaná hodnota bude null. + Expected value to be null. @@ -424,7 +554,12 @@ Skutečnost: {2} Expected condition to be true. - Očekávala se podmínka true. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf index bc6994fd6a..512defa5c8 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf @@ -68,6 +68,111 @@ Die erwartete Länge der Zeichenfolge ist {0}, war aber {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Es wurde ein beliebiger Wert erwartet außer:<{1}>. Tatsächlich:<{2}>. {0} @@ -78,6 +183,26 @@ Es wurde eine Differenz größer als <{3}> zwischen dem erwarteten Wert <{1}> und dem tatsächlichen Wert <{2}> erwartet. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Beide Werte sind <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} Die Zeichenfolge „{0}“ beginnt mit der Zeichenfolge „{1}“. {2} @@ -329,7 +459,7 @@ Tatsächlich: {2} Expected condition to be false. - Es wurde erwartet, dass die Bedingung „falsch“ lautet. + Expected condition to be false. @@ -409,12 +539,12 @@ Tatsächlich: {2} Expected value to not be null. - Erwarteter Wert darf nicht null sein. + Expected value to not be null. Expected value to be null. - Erwarteter Wert ist null. + Expected value to be null. @@ -424,7 +554,12 @@ Tatsächlich: {2} Expected condition to be true. - Es wurde erwartet, dass die Bedingung „wahr“ ist. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf index add81a9682..0e8a5863fd 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf @@ -68,6 +68,111 @@ Se esperaba una longitud de cadena {0} pero fue {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Se esperaba cualquier valor excepto <{1}>, pero es <{2}>. {0} @@ -78,6 +183,26 @@ Se esperaba una diferencia mayor que <{3}> entre el valor esperado <{1}> y el valor actual <{2}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Ambos valores son <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} La cadena "{0}" comienza con la cadena "{1}". {2} @@ -329,7 +459,7 @@ Real: {2} Expected condition to be false. - Se esperaba que la condición fuera false. + Expected condition to be false. @@ -424,7 +554,12 @@ Real: {2} Expected condition to be true. - Se esperaba que la condición fuera true. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf index b910b08c9e..f2393eb9c6 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf @@ -68,6 +68,111 @@ La longueur de chaîne attendue {0} mais était {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Toute valeur attendue sauf :<{1}>. Réel :<{2}>. {0} @@ -78,6 +183,26 @@ Différence attendue supérieure à <{3}> comprise entre la valeur attendue <{1}> et la valeur réelle <{2}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Les deux valeurs sont <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} La chaîne '{0}' commence par la chaîne '{1}'. {2} @@ -329,7 +459,7 @@ Réel : {2} Expected condition to be false. - La condition attendue doit être false. + Expected condition to be false. @@ -424,7 +554,12 @@ Réel : {2} Expected condition to be true. - Condition attendue pour être true. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf index a4706cea2d..561a73665e 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf @@ -68,6 +68,111 @@ La lunghezza della stringa prevista è {0} ma era {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Previsto qualsiasi valore tranne:<{1}>. Effettivo:<{2}>. {0} @@ -78,6 +183,26 @@ Prevista una differenza maggiore di <{3}> tra il valore previsto <{1}> e il valore effettivo <{2}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Entrambi i valori sono <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} La stringa '{0}' inizia con la stringa '{1}'. {2} @@ -329,7 +459,7 @@ Effettivo: {2} Expected condition to be false. - La condizione prevista deve essere false. + Expected condition to be false. @@ -409,12 +539,12 @@ Effettivo: {2} Expected value to not be null. - Il valore previsto non è null. + Expected value to not be null. Expected value to be null. - Il valore previsto dovrebbe essere null. + Expected value to be null. @@ -424,7 +554,12 @@ Effettivo: {2} Expected condition to be true. - La condizione prevista deve essere true. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf index 5f3fa8c2ab..16e474fec9 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf @@ -68,6 +68,111 @@ 期待される文字列の長さは {0} ですが、実際は {1} でした。 + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} <{1}> 以外の任意の値が必要ですが、<{2}> が指定されています。{0} @@ -78,6 +183,26 @@ 指定する値 <{1}> と実際の値 <{2}> との間には、<{3}> を超える差が必要です。{0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} どちらの値も<null>です。{0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} 文字列 '{0}' は文字列 '{1}' で始まります。 {2} @@ -329,7 +459,7 @@ Actual: {2} Expected condition to be false. - 予期される条件は false です。 + Expected condition to be false. @@ -424,7 +554,12 @@ Actual: {2} Expected condition to be true. - 予想される条件は true です。 + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf index 12c6954c61..af329e6b4f 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf @@ -68,6 +68,111 @@ 문자열 길이 {0}(을)를 예상했지만 {1}입니다. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} 예상 값: <{1}>을(를) 제외한 모든 값. 실제 값: <{2}>. {0} @@ -78,6 +183,26 @@ 예상 값 <{1}>과(와) 실제 값 <{2}>의 차이가 <{3}>보다 커야 합니다. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} 두 값 모두 <null>입니다. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} 문자열 '{0}'은 문자열 '{1}'(으)로 시작합니다. {2} @@ -329,7 +459,7 @@ Actual: {2} Expected condition to be false. - 조건이 false여야 합니다. + Expected condition to be false. @@ -409,12 +539,12 @@ Actual: {2} Expected value to not be null. - 값이 null이 아니어야 합니다. + Expected value to not be null. Expected value to be null. - 값이 null이어야 합니다. + Expected value to be null. @@ -424,7 +554,12 @@ Actual: {2} Expected condition to be true. - 조건이 true여야 합니다. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf index 17ae1b9d3c..2400f343a5 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf @@ -68,6 +68,111 @@ Oczekiwano ciągu o długości {0}, ale miał wartość {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Oczekiwano dowolnej wartości za wyjątkiem:<{1}>. Rzeczywista:<{2}>. {0} @@ -78,6 +183,26 @@ Oczekiwano różnicy większej niż <{3}> pomiędzy oczekiwaną wartością <{1}> a rzeczywistą wartością <{2}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Obie wartości to <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} Ciąg „{0}” rozpoczyna się od ciągu „{1}”. {2} @@ -329,7 +459,7 @@ Rzeczywiste: {2} Expected condition to be false. - Oczekiwano warunku o wartości false. + Expected condition to be false. @@ -424,7 +554,12 @@ Rzeczywiste: {2} Expected condition to be true. - Oczekiwano warunku o wartości true. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf index 598fb3b128..f154240002 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf @@ -68,6 +68,111 @@ Comprimento esperado da cadeia de caracteres {0}, mas foi {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Esperado qualquer valor exceto:<{1}>. Real:<{2}>. {0} @@ -78,6 +183,26 @@ Esperada uma diferença maior que <{3}> entre o valor esperado <{1}> e o valor real <{2}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Ambos os valores são <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} A cadeia de caracteres “{0}” começa com a cadeia de caracteres “{1}”. {2} @@ -329,7 +459,7 @@ Real: {2} Expected condition to be false. - Condição esperada como falsa. + Expected condition to be false. @@ -409,12 +539,12 @@ Real: {2} Expected value to not be null. - O valor esperado não deve ser nulo. + Expected value to not be null. Expected value to be null. - O valor esperado deve ser nulo. + Expected value to be null. @@ -424,7 +554,12 @@ Real: {2} Expected condition to be true. - Condição esperada como verdadeira. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf index a9796fb817..723aab1646 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf @@ -68,6 +68,111 @@ Ожидалась длина строки: {0}, фактическая длина строки: {1}. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Ожидается любое значение, кроме: <{1}>. Фактически: <{2}>. {0} @@ -78,6 +183,26 @@ Между ожидаемым значением <{1}> и фактическим значением <{2}> требуется разница более чем <{3}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Оба значения равны <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} Строка "{0}" начинается со строки "{1}". {2} @@ -329,7 +459,7 @@ Actual: {2} Expected condition to be false. - Ожидается, что условие будет ложным (false). + Expected condition to be false. @@ -409,12 +539,12 @@ Actual: {2} Expected value to not be null. - Ожидаемое значение не должно быть null. + Expected value to not be null. Expected value to be null. - Ожидаемое значение должно быть null. + Expected value to be null. @@ -424,7 +554,12 @@ Actual: {2} Expected condition to be true. - Ожидается, что условие будет истинным (true). + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf index e6a9ba121b..207520dbec 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf @@ -68,6 +68,111 @@ Beklenen dize uzunluğu {0} idi, ancak dize uzunluğu {1} oldu. + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} Şunun dışında bir değer bekleniyor:<{1}>. Gerçek:<{2}>. {0} @@ -78,6 +183,26 @@ Beklenen değer <{1}> ile gerçek değer <{2}> arasında, şundan büyük olan fark bekleniyor: <{3}>. {0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} Her iki değer: <null>. {0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} '{0}' dizesi '{1}' dizesi ile başlıyor. {2} @@ -329,7 +459,7 @@ Gerçekte olan: {2} Expected condition to be false. - Koşulun yanlış olması bekleniyordu. + Expected condition to be false. @@ -424,7 +554,12 @@ Gerçekte olan: {2} Expected condition to be true. - Koşulun doğru olması bekleniyordu. + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf index 19197e286b..89894d5145 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf @@ -68,6 +68,111 @@ 字符串长度应为 {0},但为 {1}。 + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} 应为: <{1}> 以外的任意值,实际为: <{2}>。{0} @@ -78,6 +183,26 @@ 预期值 <{1}> 和实际值 <{2}> 之间的差应大于 <{3}>。{0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} 两个值均为 <null>。{0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} 字符串 '{0}' 以字符串 '{1}' 开头。{2} @@ -329,7 +459,7 @@ Actual: {2} Expected condition to be false. - 预期条件为 false。 + Expected condition to be false. @@ -409,12 +539,12 @@ Actual: {2} Expected value to not be null. - 预期值不应为 null。 + Expected value to not be null. Expected value to be null. - 预期值为 null。 + Expected value to be null. @@ -424,7 +554,12 @@ Actual: {2} Expected condition to be true. - 预期条件为 true。 + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf index 6876681112..ae7770aaeb 100644 --- a/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf +++ b/src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf @@ -68,6 +68,111 @@ 預期的字串長度為 {0},但為 {1}。 + + Expected values to be structurally equivalent. + Expected values to be structurally equivalent. + + + + Expected values to be structurally equivalent (strict mode). + Expected values to be structurally equivalent (strict mode). + + + + reading the actual dictionary threw {0}: {1}. + reading the actual dictionary threw {0}: {1}. + + + + enumerating the actual collection threw {0}: {1}. + enumerating the actual collection threw {0}: {1}. + + + + reading the actual member threw {0}: {1}. + reading the actual member threw {0}: {1}. + + + + Mismatch at '{0}': {1} + Mismatch at '{0}': {1} + {0} is a member path (e.g., 'Order.Items[2].Price'), {1} is a localized reason describing the kind of mismatch. + + + reading the expected dictionary threw {0}: {1}. + reading the expected dictionary threw {0}: {1}. + + + + enumerating the expected collection threw {0}: {1}. + enumerating the expected collection threw {0}: {1}. + + + + reading the expected member threw {0}: {1}. + reading the expected member threw {0}: {1}. + + + + actual has unexpected members not present on expected: {0}. + actual has unexpected members not present on expected: {0}. + + + + IEquatable.Equals threw {0}: {1}. + IEquatable.Equals threw {0}: {1}. + + + + collections differ in length (expected {0} elements, actual {1}). + collections differ in length (expected {0} elements, actual {1}). + + + + comparison exceeded the maximum supported depth of {0}. + comparison exceeded the maximum supported depth of {0}. + + + + key {0} present on expected is missing from actual. + key {0} present on expected is missing from actual. + + + + member '{0}' present on expected is missing from actual. + member '{0}' present on expected is missing from actual. + + + + one side is null, the other is not. + one side is null, the other is not. + + + + graph topology differs (the same reference on one side appears paired with different references on the other side). + graph topology differs (the same reference on one side appears paired with different references on the other side). + + + + incompatible types (expected '{0}', actual '{1}'). + incompatible types (expected '{0}', actual '{1}'). + + + + key {0} present on actual is not on expected. + key {0} present on actual is not on expected. + + + + values are not equal. + values are not equal. + + + + <root> + <root> + Placeholder used in equivalence-mismatch messages when the difference is at the top of the object graph. + Expected any value except:<{1}>. Actual:<{2}>. {0} 預期任何值 (<{1}> 除外)。實際: <{2}>。{0} @@ -78,6 +183,26 @@ 預期值 <{1}> 和實際值 <{2}> 之間的預期差異大於 <{3}>。{0} + + Could not complete structural comparison. + Could not complete structural comparison. + + + + Could not complete structural comparison (strict mode). + Could not complete structural comparison (strict mode). + + + + Expected values to be structurally different. + Expected values to be structurally different. + + + + Expected values to be structurally different (strict mode). + Expected values to be structurally different (strict mode). + + Both values are <null>. {0} 兩個值均為 <null>。{0} @@ -248,6 +373,11 @@ Expected string to not end with the specified suffix. + + Expected string to not match the specified regular expression. + Expected string to not match the specified regular expression. + + String '{0}' starts with string '{1}'. {2} 字串 '{0}' 以字串 '{1}' 開頭。{2} @@ -329,7 +459,7 @@ Actual: {2} Expected condition to be false. - 預期條件為 False。 + Expected condition to be false. @@ -409,12 +539,12 @@ Actual: {2} Expected value to not be null. - 預期值不可為 Null。 + Expected value to not be null. Expected value to be null. - 預期值可為 Null。 + Expected value to be null. @@ -424,7 +554,12 @@ Actual: {2} Expected condition to be true. - 預期條件為 True。 + Expected condition to be true. + + + + Expected string to match the specified regular expression. + Expected string to match the specified regular expression. diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs b/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs new file mode 100644 index 0000000000..c2bee0fd0f --- /dev/null +++ b/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.MatchesRegex.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Text.RegularExpressions; + +using AwesomeAssertions; + +namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; + +public partial class AssertTests +{ + public void MatchesRegex_WithRegexPattern_OnSuccess_DoesNotThrow() + => FluentActions.Invoking(() => Assert.MatchesRegex(new Regex("^he"), "hello")) + .Should().NotThrow(); + + public void MatchesRegex_WithStringPattern_OnSuccess_DoesNotThrow() + => FluentActions.Invoking(() => Assert.MatchesRegex("^he", "hello")) + .Should().NotThrow(); + + public void MatchesRegex_WithRegexPattern_OnFailure_UsesStructuredMessageAndPayload() + { + Action action = () => Assert.MatchesRegex(new Regex("^foo"), "hello", "User-provided message"); + + AssertFailedException ex = action.Should().Throw() + .WithMessage( + """ + Assertion failed. Expected string to match the specified regular expression. + User-provided message + + expected pattern: "^foo" + actual: "hello" + + Assert.MatchesRegex(new Regex("^foo"), "hello") + """) + .Which; + + ex.ExpectedText.Should().Be("\"^foo\""); + ex.ActualText.Should().Be("\"hello\""); + ex.Data["assert.expected"].Should().Be(ex.ExpectedText); + ex.Data["assert.actual"].Should().Be(ex.ActualText); + } + + public void MatchesRegex_WithStringPattern_OnFailure_UsesStructuredMessage() + { + string pattern = "^foo"; + string value = "hello"; + Action action = () => Assert.MatchesRegex(pattern, value); + + action.Should().Throw() + .WithMessage( + """ + Assertion failed. Expected string to match the specified regular expression. + + expected pattern: "^foo" + actual: "hello" + + Assert.MatchesRegex(pattern, value) + """); + } + + public void DoesNotMatchRegex_WithRegexPattern_OnSuccess_DoesNotThrow() + => FluentActions.Invoking(() => Assert.DoesNotMatchRegex(new Regex("world"), "hello")) + .Should().NotThrow(); + + public void DoesNotMatchRegex_WithStringPattern_OnSuccess_DoesNotThrow() + => FluentActions.Invoking(() => Assert.DoesNotMatchRegex("world", "hello")) + .Should().NotThrow(); + + public void DoesNotMatchRegex_WithRegexPattern_OnFailure_UsesStructuredMessageAndPayload() + { + Action action = () => Assert.DoesNotMatchRegex(new Regex("world"), "hello world", "User-provided message"); + + AssertFailedException ex = action.Should().Throw() + .WithMessage( + """ + Assertion failed. Expected string to not match the specified regular expression. + User-provided message + + unexpected pattern: "world" + actual: "hello world" + + Assert.DoesNotMatchRegex(new Regex("world"), "hello world") + """) + .Which; + + ex.ExpectedText.Should().Be("\"world\""); + ex.ActualText.Should().Be("\"hello world\""); + ex.Data["assert.expected"].Should().Be(ex.ExpectedText); + ex.Data["assert.actual"].Should().Be(ex.ActualText); + } + + public void DoesNotMatchRegex_WithStringPattern_OnFailure_UsesStructuredMessage() + { + string pattern = "world"; + string value = "hello world"; + Action action = () => Assert.DoesNotMatchRegex(pattern, value); + + action.Should().Throw() + .WithMessage( + """ + Assertion failed. Expected string to not match the specified regular expression. + + unexpected pattern: "world" + actual: "hello world" + + Assert.DoesNotMatchRegex(pattern, value) + """); + } +}