111 references to Format
Microsoft.DotNet.XUnitAssert.Tests (49)
CollectionAssertsTests.cs (2)
795
Environment.NewLine + "Expected: " + expectedType + ArgumentFormatter.
Format
(expected) +
796
Environment.NewLine + "Actual: " + actualType + ArgumentFormatter.
Format
(actual);
EqualityAssertsTests.cs (18)
1748
$"Expected: {ArgumentFormatter.
Format
(expected)}" + Environment.NewLine +
1749
$"Actual: {ArgumentFormatter.
Format
(actual)}",
1786
$"Expected: {ArgumentFormatter.
Format
(date1)}" + Environment.NewLine +
1787
$"Actual: {ArgumentFormatter.
Format
(date2)} (difference {difference} is larger than {precision})",
1797
$"Expected: {ArgumentFormatter.
Format
(date2)}" + Environment.NewLine +
1798
$"Actual: {ArgumentFormatter.
Format
(date1)} (difference {difference} is larger than {precision})",
1834
$"Expected: {ArgumentFormatter.
Format
(expected)}" + Environment.NewLine +
1835
$"Actual: {ArgumentFormatter.
Format
(actual)}",
1867
$"Expected: {ArgumentFormatter.
Format
(expected)}" + Environment.NewLine +
1868
$"Actual: {ArgumentFormatter.
Format
(actual)}",
1905
$"Expected: {ArgumentFormatter.
Format
(date1)}" + Environment.NewLine +
1906
$"Actual: {ArgumentFormatter.
Format
(date2)} (difference {difference} is larger than {precision})",
1916
$"Expected: {ArgumentFormatter.
Format
(date2)}" + Environment.NewLine +
1917
$"Actual: {ArgumentFormatter.
Format
(date1)} (difference {difference} is larger than {precision})",
1954
$"Expected: {ArgumentFormatter.
Format
(date1)}" + Environment.NewLine +
1955
$"Actual: {ArgumentFormatter.
Format
(date2)} (difference {difference} is larger than {precision})",
1965
$"Expected: {ArgumentFormatter.
Format
(date2)}" + Environment.NewLine +
1966
$"Actual: {ArgumentFormatter.
Format
(date1)} (difference {difference} is larger than {precision})",
MemoryAssertsTests.cs (2)
631
Environment.NewLine + "Expected: " + ArgumentFormatter.
Format
(expected) +
632
Environment.NewLine + "Actual: " + ArgumentFormatter.
Format
(actual);
Sdk\ArgumentFormatterTests.cs (23)
83
Assert.Equal(expected.Replace("$$ELLIPSIS$$", ArgumentFormatter.Ellipsis), ArgumentFormatter.
Format
(value));
124
Assert.Equal(expected, ArgumentFormatter.
Format
(value));
136
Assert.Equal(floatPI.ToString("G9"), ArgumentFormatter.
Format
(floatPI));
146
Assert.Equal(Math.PI.ToString("G17"), ArgumentFormatter.
Format
(Math.PI));
156
Assert.Equal(123.45M.ToString(), ArgumentFormatter.
Format
(123.45M));
168
Assert.Equal(now.ToString("o"), ArgumentFormatter.
Format
(now));
180
Assert.Equal(now.ToString("o"), ArgumentFormatter.
Format
(now));
189
Assert.Equal("Task { Status = RanToCompletion }", ArgumentFormatter.
Format
(task));
198
Assert.Equal("Task<int> { Status = Faulted }", ArgumentFormatter.
Format
(taskCompletionSource.Task));
251
var actual = ArgumentFormatter.
Format
(enumValue);
278
var actual = ArgumentFormatter.
Format
(enumValue);
296
Assert.Equal(expected, ArgumentFormatter.
Format
(kvp));
319
Assert.Equal(expected, ArgumentFormatter.
Format
(collection));
336
Assert.Equal(expected, ArgumentFormatter.
Format
(value));
353
Assert.Equal($"[0, 1, 2, 3, 4, {ArgumentFormatter.Ellipsis}]", ArgumentFormatter.
Format
(collection));
367
Assert.Equal($"[42, [42, [{ArgumentFormatter.Ellipsis}]]]", ArgumentFormatter.
Format
(looping));
382
Assert.Equal(expected, ArgumentFormatter.
Format
(new MyComplexType()));
412
Assert.Equal(expected, ArgumentFormatter.
Format
(new MyComplexTypeWrapper()));
429
Assert.Equal("Object { }", ArgumentFormatter.
Format
(new object()));
439
Assert.Equal("ThrowingGetter { MyThrowingProperty = (throws NotImplementedException) }", ArgumentFormatter.
Format
(new ThrowingGetter()));
456
Assert.Equal(expected, ArgumentFormatter.
Format
(new Big()));
489
Assert.Equal($"Looping {{ Me = Looping {{ Me = Looping {{ {ArgumentFormatter.Ellipsis} }} }} }}", ArgumentFormatter.
Format
(new Looping()));
502
Assert.Equal("This is what you should show", ArgumentFormatter.
Format
(new TypeWithToString()));
SpanAssertsTests.cs (2)
631
Environment.NewLine + "Expected: " + ArgumentFormatter.
Format
(expected) +
632
Environment.NewLine + "Actual: " + ArgumentFormatter.
Format
(actual);
StringAssertsTests.cs (2)
673
Environment.NewLine + "Expected: " + ArgumentFormatter.
Format
(expected) +
674
Environment.NewLine + "Actual: " + ArgumentFormatter.
Format
(actual);
xunit.assert (62)
CollectionAsserts.cs (6)
84
errors.Add(new Tuple<int, string, Exception>(idx, ArgumentFormatter.
Format
(item), ex));
138
errors.Add(new Tuple<int, string, Exception>(idx, ArgumentFormatter.
Format
(item), ex));
282
throw ContainsException.ForCollectionItemNotFound(ArgumentFormatter.
Format
(expected), tracker.FormatStart());
338
throw DistinctException.ForDuplicateItem(ArgumentFormatter.
Format
(item), tracker.FormatStart());
404
ArgumentFormatter.
Format
(expected),
652
GetSingleResult(collection.Cast<object>(), item => object.Equals(item, expected), ArgumentFormatter.
Format
(expected));
DictionaryAsserts.cs (4)
62
ArgumentFormatter.
Format
(expected),
96
ArgumentFormatter.
Format
(expected),
219
ArgumentFormatter.
Format
(expected),
245
ArgumentFormatter.
Format
(expected),
EqualityAsserts.cs (16)
243
formattedExpected = expectedTracker?.FormatIndexedMismatch(expectedStartIdx, expectedEndIdx, mismatchedIndex, out expectedPointer) ?? ArgumentFormatter.
Format
(expected);
247
formattedActual = actualTracker?.FormatIndexedMismatch(actualStartIdx, actualEndIdx, mismatchedIndex, out actualPointer) ?? ArgumentFormatter.
Format
(actual);
262
formattedExpected = ArgumentFormatter.
Format
(expected);
263
formattedActual = ArgumentFormatter.
Format
(actual);
527
ArgumentFormatter.
Format
(actual) +
561
ArgumentFormatter.
Format
(actual) +
689
var formattedExpected = ArgumentFormatter.
Format
(expected);
690
var formattedActual = ArgumentFormatter.
Format
(actual);
758
formattedExpected = expectedTracker?.FormatIndexedMismatch(expectedStartIdx, expectedEndIdx, mismatchedIndex, out expectedPointer) ?? ArgumentFormatter.
Format
(expected);
761
formattedActual = actualTracker?.FormatIndexedMismatch(actualStartIdx, actualEndIdx, mismatchedIndex, out actualPointer) ?? ArgumentFormatter.
Format
(actual);
776
formattedExpected = ArgumentFormatter.
Format
(expected);
777
formattedActual = ArgumentFormatter.
Format
(actual);
1005
ArgumentFormatter.
Format
(expected),
1006
ArgumentFormatter.
Format
(actual)
1034
ArgumentFormatter.
Format
(expected),
1035
ArgumentFormatter.
Format
(actual)
IdentityAsserts.cs (2)
55
ArgumentFormatter.
Format
(expected),
56
ArgumentFormatter.
Format
(actual)
Sdk\ArgumentFormatter.cs (5)
420
result.Append(
Format
(current, nextDepth));
462
result.Append(
Format
(value, depth + 1));
550
return string.Format(CultureInfo.CurrentCulture, "[{0}] = {1}",
Format
(k),
Format
(v));
711
return
Format
(getter(), depth + 1);
Sdk\CollectionTracker.cs (2)
637
printedValues.Append(ArgumentFormatter.
Format
(items[idx], depth));
741
printedValues.Append(ArgumentFormatter.
Format
(items[idx], depth));
Sdk\Exceptions\EqualException.cs (2)
225
var expectedText = expected as string ?? ArgumentFormatter.
Format
(expected);
226
var actualText = actual as string ?? ArgumentFormatter.
Format
(actual);
Sdk\Exceptions\EquivalentException.cs (9)
104
ArgumentFormatter.
Format
(expected),
106
ArgumentFormatter.
Format
(actual)
163
ArgumentFormatter.
Format
(expected),
165
ArgumentFormatter.
Format
(actual)
193
ArgumentFormatter.
Format
(expected),
195
ArgumentFormatter.
Format
(actual)
228
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(expected), expected)),
230
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(actualLeftovers), actualLeftovers)),
231
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(actual), actual))
Sdk\Exceptions\InRangeException.cs (3)
45
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(low), low)),
46
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(high), high)),
48
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(actual), actual))
Sdk\Exceptions\MatchesException.cs (2)
47
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(expectedRegexPattern), expectedRegexPattern)),
49
ArgumentFormatter.
Format
(actual)
Sdk\Exceptions\NotInRangeException.cs (3)
45
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(low), low)),
46
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(high), high)),
48
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(actual), actual))
Sdk\Exceptions\NullException.cs (2)
55
ArgumentFormatter.
Format
(actual)
78
ArgumentFormatter.
Format
(Assert.GuardArgumentNotNull(nameof(actual), actual))
Sdk\Exceptions\ThrowsException.cs (2)
82
ArgumentFormatter.
Format
(expectedParamName),
84
ArgumentFormatter.
Format
(actualParamName)
SetAsserts.cs (4)
45
ArgumentFormatter.
Format
(expected),
72
ArgumentFormatter.
Format
(expected),
143
ArgumentFormatter.
Format
(expected),
169
ArgumentFormatter.
Format
(expected),