Skip to content

Commit 0ef3a45

Browse files
committed
Partially improve CollectionAssert message
1 parent ac9cc4c commit 0ef3a45

16 files changed

+44
-42
lines changed

src/TestFramework/TestFramework/Assertions/CollectionAssert.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@ private static bool CompareIEnumerable(IEnumerable? expected, IEnumerable? actua
16561656
reason = string.Format(
16571657
CultureInfo.CurrentCulture,
16581658
FrameworkMessages.ElementsAtIndexDontMatch,
1659-
position);
1659+
position,
1660+
Assert.ReplaceNulls(curExpected),
1661+
Assert.ReplaceNulls(curActual));
16601662
return false;
16611663
}
16621664
}

src/TestFramework/TestFramework/Resources/FrameworkMessages.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TestFramework/TestFramework/Resources/FrameworkMessages.resx

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
<value>The number of elements in the collections do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.{0}</value>
170170
</data>
171171
<data name="ElementsAtIndexDontMatch" xml:space="preserve">
172-
<value>Element at index {0} do not match.</value>
172+
<value>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</value>
173173
</data>
174174
<data name="ElementTypesAtIndexDontMatch" xml:space="preserve">
175175
<value>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</value>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">Element na indexu {0} nesouhlasí.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">Die Elemente bei Index "{0}" stimmen nicht überein.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">El elemento del índice {0} no coincide.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">Les éléments à l'index {0} ne correspondent pas.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">L'elemento alla posizione di indice {0} non corrisponde.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">インデックス {0} の要素が一致しません。</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">인덱스 {0}에 있는 요소가 일치하지 않습니다.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">Element w indeksie {0} nie jest zgodny.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">O elemento no índice {0} não corresponde.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">Элемент по индексу {0} не совпадает.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">{0} dizinindeki öğe eşleşmiyor.</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">索引 {0} 处的元素不匹配。</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@
9898
<note></note>
9999
</trans-unit>
100100
<trans-unit id="ElementsAtIndexDontMatch">
101-
<source>Element at index {0} do not match.</source>
102-
<target state="translated">位於索引 {0} 的項目不符。</target>
103-
<note></note>
101+
<source>Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</source>
102+
<target state="new">Element at index {0} do not match. Expected:&lt;{1}&gt;. Actual:&lt;{2}&gt;.</target>
103+
<note />
104104
</trans-unit>
105105
<trans-unit id="ElementTypesAtIndexDontMatch">
106106
<source>Element at index {1} is not of expected type. Expected type:&lt;{2}&gt;. Actual type:&lt;{3}&gt;.{0}</source>

0 commit comments

Comments
 (0)