2 instantiations of CollectionTracker
xunit.assert (2)
Sdk\CollectionTracker.cs (2)
393 new CollectionTracker<object>(enumerable, enumerable.Cast<object>()); 744 new CollectionTracker<T>(collection);
74 references to CollectionTracker
Microsoft.DotNet.XUnitAssert.Tests (26)
Asserts\MemoryAssertsTests.cs (1)
406 "Memory: " + CollectionTracker<int>.FormatStart(data) + Environment.NewLine +
Asserts\Sdk\ArgumentFormatterTests.cs (2)
270 new(CollectionTracker<object>.Wrap([1, 2.3M, "Hello, world!"])), 306 new(CollectionTracker<object>.Wrap([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])),
Asserts\Sdk\CollectionTrackerTests.cs (22)
11 var tracker = new[] { 42, 2112 }.AsTracker(); 23 var tracker = new[] { 42, 2112 }.AsTracker(); 35 var tracker = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsTracker(); 47 var tracker = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsTracker(); 59 var tracker = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsTracker(); 76 var result = CollectionTracker<int>.FormatIndexedMismatch(span, 2600, out var pointerIndent, ArgumentFormatter.MaxEnumerableLength + 1); 88 var result = CollectionTracker<int>.FormatIndexedMismatch(span, 0, out var pointerIndent); 100 var result = CollectionTracker<int>.FormatIndexedMismatch(span, 1, out var pointerIndent); 112 var result = CollectionTracker<int>.FormatIndexedMismatch(span, 3, out var pointerIndent); 124 var result = CollectionTracker<int>.FormatIndexedMismatch(span, 6, out var pointerIndent); 137 var tracker = Array.Empty<object>().AsTracker(); 145 var tracker = Array.Empty<object>().AsTracker(); 153 var tracker = new object[] { 1, 2.3M, "Hello, world!" }.AsTracker(); 161 var tracker = new object[] { 1, 2.3M, "Hello, world!", 42, 2112, new() }.AsTracker(); 174 Assert.Equal("[]", CollectionTracker<object>.FormatStart(collection)); 182 Assert.Equal($"[{ArgumentFormatter.Ellipsis}]", CollectionTracker<object>.FormatStart(collection, ArgumentFormatter.MaxEnumerableLength + 1)); 190 Assert.Equal($"[1, {2.3M}, \"Hello, world!\"]", CollectionTracker<object>.FormatStart(collection)); 198 Assert.Equal($"[1, {2.3M}, \"Hello, world!\", 42, 2112, {ArgumentFormatter.Ellipsis}]", CollectionTracker<object>.FormatStart(collection)); 209 Assert.Equal("[]", CollectionTracker<object>.FormatStart(span)); 217 Assert.Equal($"[{ArgumentFormatter.Ellipsis}]", CollectionTracker<object>.FormatStart(span, ArgumentFormatter.MaxEnumerableLength + 1)); 225 Assert.Equal($"[1, {2.3M}, \"Hello, world!\"]", CollectionTracker<object>.FormatStart(span)); 233 Assert.Equal($"[1, {2.3M}, \"Hello, world!\", 42, 2112, {ArgumentFormatter.Ellipsis}]", CollectionTracker<object>.FormatStart(span));
Asserts\SpanAssertsTests.cs (1)
406 "Span: " + CollectionTracker<int>.FormatStart(data) + Environment.NewLine +
xunit.assert (48)
CollectionAsserts.cs (8)
242 using (var tracker = collection.AsTracker()) 282 using (var tracker = collection.AsTracker()) 355 using (var tracker = collection.AsTracker()) 374 using (var tracker = collection.AsTracker()) 407 using (var tracker = collection.AsTracker()) 465 using (var tracker = collection.AsTracker()) 502 using (var tracker = collection.AsTracker()) 769 using (var tracker = collection.AsTracker())
DictionaryAsserts.cs (4)
43 CollectionTracker<TKey>.FormatStart(collection.Keys) 71 CollectionTracker<TKey>.FormatStart(collection.Keys) 167 CollectionTracker<TKey>.FormatStart(collection.Keys) 193 CollectionTracker<TKey>.FormatStart(collection.Keys)
MemoryAsserts.cs (4)
72 CollectionTracker<T>.FormatStart(expectedSubMemory.Span), 73 CollectionTracker<T>.FormatStart(actualMemory.Span) 132 var formattedExpected = CollectionTracker<T>.FormatStart(expectedSpan); 133 var formattedActual = CollectionTracker<T>.FormatIndexedMismatch(actualSpan, idx, out var failurePointerIndent);
Sdk\CollectionTracker.cs (6)
37 /// Base class for generic <see cref="CollectionTracker{T}"/>, which also includes some public 369 /// returned by <see cref="CollectionTracker{T}.GetEnumerator"/>, except non-generic. 389 /// Wraps an untyped enumerable in an object-based <see cref="CollectionTracker{T}"/>. 392 public static CollectionTracker<object> Wrap(IEnumerable enumerable) => 740 /// Wraps the given collection inside of a <see cref="CollectionTracker{T}"/>. 743 public static CollectionTracker<T> Wrap(IEnumerable<T> collection) =>
Sdk\CollectionTrackerExtensions.cs (5)
19 /// Extension methods related to <see cref="CollectionTracker{T}"/>. 41 /// Wraps the given enumerable in an instance of <see cref="CollectionTracker{T}"/>. 47 public static CollectionTracker<T>? AsTracker<T>(this IEnumerable<T>? enumerable) => 53 : enumerable as CollectionTracker<T> ?? CollectionTracker<T>.Wrap(enumerable);
Sdk\CollectionTrackerExtensions_aot.cs (1)
21 /// Wraps the given enumerable in an instance of <see cref="CollectionTracker{T}"/>.
SetAsserts.cs (12)
35 CollectionTracker<T>.FormatStart(set) 58 CollectionTracker<T>.FormatStart(set) 128 CollectionTracker<T>.FormatStart(set) 150 CollectionTracker<T>.FormatStart(set) 223 CollectionTracker<T>.FormatStart(expectedSubset), 224 actual == null ? "null" : CollectionTracker<T>.FormatStart(actual) 247 CollectionTracker<T>.FormatStart(expectedSuperset), 248 actual == null ? "null" : CollectionTracker<T>.FormatStart(actual) 271 CollectionTracker<T>.FormatStart(expectedSubset), 272 actual == null ? "null" : CollectionTracker<T>.FormatStart(actual) 295 CollectionTracker<T>.FormatStart(expectedSuperset), 296 actual == null ? "null" : CollectionTracker<T>.FormatStart(actual)
SetAsserts_aot.cs (4)
280 var expectedFormatted = CollectionTracker<T>.FormatStart(expected); 281 var actualFormatted = actual == null ? "null" : CollectionTracker<T>.FormatStart(actual); 311 var expectedFormatted = CollectionTracker<T>.FormatStart(expected); 312 var actualFormatted = actual == null ? "null" : CollectionTracker<T>.FormatStart(actual);
SpanAsserts.cs (4)
70 CollectionTracker<T>.FormatStart(expectedSubSpan), 71 CollectionTracker<T>.FormatStart(actualSpan) 125 var formattedExpected = CollectionTracker<T>.FormatStart(expectedSubSpan); 126 var formattedActual = CollectionTracker<T>.FormatIndexedMismatch(actualSpan, idx, out var failurePointerIndent);