Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi committed Oct 24, 2024
1 parent 9017d79 commit abdb923
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions DuckDB.NET.Test/ModuleInit.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using DuckDB.NET.Test.Helpers;
using FluentAssertions;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

#nullable enable
Expand All @@ -12,8 +13,19 @@ public static void Init()
{
NativeLibraryHelper.TryLoad();

AssertionOptions.AssertEquivalencyUsing(options => options.ComparingByMembers<DateTimeOffset>().Including(info =>
info.Name == nameof(DateTimeOffset.Offset) ||
info.Name == nameof(DateTimeOffset.TimeOfDay)));
AssertionOptions.AssertEquivalencyUsing(options => options.Using<DateTimeOffset>(new DateTimeOffsetTimeComparer()));
}

class DateTimeOffsetTimeComparer : IEqualityComparer<DateTimeOffset>
{
public bool Equals(DateTimeOffset x, DateTimeOffset y)
{
return x.Offset==y.Offset && x.TimeOfDay==y.TimeOfDay;
}

public int GetHashCode(DateTimeOffset obj)
{
return obj.GetHashCode();
}
}
}

0 comments on commit abdb923

Please sign in to comment.