forked from xunit/assert.xunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComparers.cs
More file actions
33 lines (30 loc) · 681 Bytes
/
Comparers.cs
File metadata and controls
33 lines (30 loc) · 681 Bytes
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
#if XUNIT_NULLABLE
#nullable enable
#endif
using System;
using System.Collections;
using System.Collections.Generic;
using Xunit.Sdk;
namespace Xunit
{
#if XUNIT_VISIBILITY_INTERNAL
internal
#else
public
#endif
partial class Assert
{
static IComparer<T> GetComparer<T>()
where T : IComparable
{
return new AssertComparer<T>();
}
#if XUNIT_NULLABLE
static IEqualityComparer<T?> GetEqualityComparer<T>(IEqualityComparer? innerComparer = null) =>
new AssertEqualityComparer<T?>(innerComparer);
#else
static IEqualityComparer<T> GetEqualityComparer<T>(IEqualityComparer innerComparer = null) =>
new AssertEqualityComparer<T>(innerComparer);
#endif
}
}