
public static class AssertionsExtensions
{
  public static AndConstraint<TAssertions> Equal<TSubject, TAssertions>(this ReferenceTypeAssertions<TSubject, TAssertions> assertions, TSubject? other, IEqualityComparer<TSubject> comparer, string because = "", params object[] becauseArgs)
    where TAssertions : ReferenceTypeAssertions<TSubject, TAssertions>
  {
    return assertions.Match(x => comparer.Equals(x, other), because, becauseArgs);
  }

  public static AndConstraint<ObjectAssertions> Equal<TSubject>(this ObjectAssertions assertions, TSubject? other, IEqualityComparer<TSubject?> comparer, string because = "", params object[] becauseArgs)
    where TSubject : class
  {
    return assertions.Match(x => comparer.Equals(x as TSubject, other), because, becauseArgs);
  }