File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 11using DuckDB . NET . Test . Helpers ;
22using FluentAssertions ;
33using System ;
4+ using System . Collections . Generic ;
45using System . Runtime . CompilerServices ;
56
67#nullable enable
@@ -12,8 +13,19 @@ public static void Init()
1213 {
1314 NativeLibraryHelper . TryLoad ( ) ;
1415
15- AssertionOptions . AssertEquivalencyUsing ( options => options . ComparingByMembers < DateTimeOffset > ( ) . Including ( info =>
16- info . Name == nameof ( DateTimeOffset . Offset ) ||
17- info . Name == nameof ( DateTimeOffset . TimeOfDay ) ) ) ;
16+ AssertionOptions . AssertEquivalencyUsing ( options => options . Using < DateTimeOffset > ( new DateTimeOffsetTimeComparer ( ) ) ) ;
17+ }
18+
19+ class DateTimeOffsetTimeComparer : IEqualityComparer < DateTimeOffset >
20+ {
21+ public bool Equals ( DateTimeOffset x , DateTimeOffset y )
22+ {
23+ return x . Offset == y . Offset && x . TimeOfDay == y . TimeOfDay ;
24+ }
25+
26+ public int GetHashCode ( DateTimeOffset obj )
27+ {
28+ return obj . GetHashCode ( ) ;
29+ }
1830 }
1931}
You can’t perform that action at this time.
0 commit comments