/
AssertionOptions.cs
45 lines (38 loc) · 1.43 KB
/
AssertionOptions.cs
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
#region
using System;
using FluentAssertions.Equivalency;
#endregion
namespace FluentAssertions
{
/// <summary>
/// Holds any global options that control the behavior of FluentAssertions.
/// </summary>
public static class AssertionOptions
{
private static EquivalencyAssertionOptions defaults = new EquivalencyAssertionOptions();
static AssertionOptions()
{
EquivalencySteps = new EquivalencyStepCollection();
}
public static EquivalencyAssertionOptions<T> CloneDefaults<T>()
{
return new EquivalencyAssertionOptions<T>(defaults);
}
/// <summary>
/// Allows configuring the defaults used during a structural equivalency assertion.
/// </summary>
/// <param name="defaultsConfigurer">
/// An action that is used to configure the defaults.
/// </param>
public static void AssertEquivalencyUsing(
Func<EquivalencyAssertionOptions, EquivalencyAssertionOptions> defaultsConfigurer)
{
defaults = defaultsConfigurer(defaults);
}
/// <summary>
/// Represents a mutable collection of steps that are executed while asserting a (collection of) object(s)
/// is structurally equivalent to another (collection of) object(s).
/// </summary>
public static EquivalencyStepCollection EquivalencySteps { get; private set; }
}
}