Description
First let me say I absolutely love this library, when I switched to it from xUnit I thought it was broken at first because it was so fast.
Unfortunately I have an error with the mocking library. Mocking the Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry type in EFCore 10 results in a build error.
Expected Behavior
To be able to mock the type without any errors. I want to use it to unit test a dbContext interceptor.
Actual Behavior
The generated source code has the following error preventing build:
'EntityEntryMockImpl.Instance': no suitable method found to override
Drilling down into the generated code the issue appears to be with this block:
public override global::Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry Instance
{
get => _engine.HandleCallWithReturn<global::Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry>(39, "get_Instance", global::System.Array.Empty<object?>(), default!);
}
Steps to Reproduce
using TUnit.Mocks;
using Microsoft.EntityFrameworkCore.ChangeTracking;
public class ReproduceError
{
private void MockEntityEntry()
{
var mocked = EntityEntry.Mock();
}
}
TUnit Version
TUnit.Mocks 1.37.36-beta
.NET Version
.NET 10.0
Operating System
Windows
IDE / Test Runner
Visual Studio
Error Output / Stack Trace
'EntityEntryMockImpl.Instance': no suitable method found to override
Additional Context
No response
IDE-Specific Issue?
Description
First let me say I absolutely love this library, when I switched to it from xUnit I thought it was broken at first because it was so fast.
Unfortunately I have an error with the mocking library. Mocking the
Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntrytype in EFCore 10 results in a build error.Expected Behavior
To be able to mock the type without any errors. I want to use it to unit test a dbContext interceptor.
Actual Behavior
The generated source code has the following error preventing build:
'EntityEntryMockImpl.Instance': no suitable method found to override
Drilling down into the generated code the issue appears to be with this block:
Steps to Reproduce
TUnit Version
TUnit.Mocks 1.37.36-beta
.NET Version
.NET 10.0
Operating System
Windows
IDE / Test Runner
Visual Studio
Error Output / Stack Trace
'EntityEntryMockImpl.Instance': no suitable method found to overrideAdditional Context
No response
IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE