Bug report checklist
Description
TUnit0023 is reported when Dispose() is called by casting to IDisposable as shown below.
Expected Behavior
No warning
Actual Behavior
TUnit0023: obj should be disposed within a clean up method
Steps to Reproduce
class MyObject : IDisposable
{
void IDisposable.Dispose() => throw new NotImplementedException();
}
public sealed class MyTest : IDisposable
{
public MyTest()
{
obj = new();
}
readonly MyObject obj;
public void Dispose() => ((IDisposable)obj).Dispose();
[Test]
public void Test() { }
}
TUnit Version
1.67.0
.NET Version
any
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
Bug report checklist
Description
TUnit0023 is reported when
Dispose()is called by casting toIDisposableas shown below.Expected Behavior
No warning
Actual Behavior
TUnit0023: obj should be disposed within a clean up method
Steps to Reproduce
TUnit Version
1.67.0
.NET Version
any
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE