-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathAssertOverrides.cs
More file actions
55 lines (49 loc) · 2.14 KB
/
AssertOverrides.cs
File metadata and controls
55 lines (49 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma warning disable CA1052 // Static holder types should be static
#if XUNIT_NULLABLE
#nullable enable
#endif
using Xunit.Sdk;
namespace Xunit
{
partial class Assert
{
/// <summary>
/// Overrides the maximum number of items to show for enumerables in assertion failure messages
/// (for the current test).
/// </summary>
/// <param name="maxLength">Pass <c>0</c> to disable truncation; pass <see langword="null"/>
/// to revert to the global setting</param>
public static void OverrideMaxEnumerableLength(int? maxLength)
=> ArgumentFormatter.OverrideMaxEnumerableLength(maxLength);
/// <summary>
/// Overrides the maximum depth to show for complex objects in assertion failure messages
/// (for the current test).
/// </summary>
/// <param name="maxDepth">Pass <c>0</c> to disable truncation; pass <see langword="null"/>
/// to revert to the global setting</param>
/// <remarks>
/// In Native AOT mode, complex objects are not printed; setting this value will have no effect on the resulting assertion message.
/// </remarks>
public static void OverrideMaxObjectDepth(int? maxDepth)
=> ArgumentFormatter.OverrideMaxObjectDepth(maxDepth);
/// <summary>
/// Overrides the maximum number of members to show for complex objects in assertion failure messages
/// (for current test).
/// </summary>
/// <param name="maxCount">Pass <c>0</c> to disable truncation; pass <see langword="null"/>
/// to revert to the global setting</param>
/// <remarks>
/// In Native AOT mode, complex objects are not printed; setting this value will have no effect on the resulting assertion message.
/// </remarks>
public static void OverrideMaxObjectMemberCount(int? maxCount)
=> ArgumentFormatter.OverrideMaxObjectMemberCount(maxCount);
/// <summary>
/// Overrides the maximum string length used in assertion failure messages
/// (for current test).
/// </summary>
/// <param name="maxLength">Pass <c>0</c> to disable truncation; pass <see langword="null"/>
/// to revert to the global setting</param>
public static void OverrideMaxStringLength(int? maxLength)
=> ArgumentFormatter.OverrideMaxStringLength(maxLength);
}
}