Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomhurst committed Feb 15, 2025
1 parent a135459 commit 6737095
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion TUnit.Core/DiscoveredTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ internal abstract record DiscoveredTest : IComparable<DiscoveredTest>, IComparab
public IHookExecutor? HookExecutor { get; internal set; }

internal Dependency[] Dependencies { get; set; } = [];


public virtual bool Equals(DiscoveredTest? other)
{
return other?.TestDetails.TestId == TestDetails.TestId;
}

public override int GetHashCode()
{
return TestDetails.TestId.GetHashCode();
}

public int CompareTo(object? obj)
{
return CompareTo(obj as DiscoveredTest);
Expand Down
10 changes: 10 additions & 0 deletions TUnit.Core/Models/Dependency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@
internal record Dependency(DiscoveredTest Test, bool ProceedOnFailure)
{
public TestDetails TestDetails => Test.TestDetails;

public virtual bool Equals(Dependency? other)
{
return other?.TestDetails.TestId == TestDetails.TestId;
}

public override int GetHashCode()
{
return TestDetails.TestId.GetHashCode();
}
}

0 comments on commit 6737095

Please sign in to comment.