-
-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
I cannot write assertions directly on System.Collections.Immutable.ImmutableHashSet<T>, which implements both IReadonlySet<T> and ISet<T>. Workaround is to cast it as one of those types first.
This was working in version 1.7.20.
Expected Behavior
I expected the code to compile.
Actual Behavior
It gives this error:
The call is ambiguous between the following methods or properties: 'TUnit.Assertions.Assert.That<TItem>(System.Collections.Generic.IReadOnlySet<TItem>?, string?)' and 'TUnit.Assertions.Assert.That<TItem>(System.Collections.Generic.ISet<TItem>?, string?)'
Steps to Reproduce
Minimal reproduction code:
[Test]
public async Task Set_is_empty()
{
var set = ImmutableHashSet<int>.Empty;
await Assert.That(set).IsEmpty();
}TUnit Version
1.11.8
.NET Version
.NET 10
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
- I've confirmed this issue occurs when running via
dotnet testordotnet run, not just in my IDE
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working