You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Mocking of interfaces using parameters called @event fails #5083
When trying to mock an interface with Mock.Of<Interface> and any method contains @event as a parameter name, the mocking fails. The problem probably also appears when using other keywords that are escaped with @
Expected Behavior
Successful compilation
Actual Behavior
Compiler Errors
Steps to Reproduce
Try to mock this interface:
public interface ITest
{
void Test(string @event);
}
TUnit Version
1.18.21-beta
.NET Version
.NET 10.0
Operating System
Windows
IDE / Test Runner
JetBrains Rider
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE
Activity
fix(mocks): escape C# keyword parameter names in generated mock code
fix(mocks): escape C# keyword parameter names in generated mock code (#…