diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_Extension_Discovery.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_Extension_Discovery.verified.txt
index 74df5e37c6..2fc30a83fe 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_Extension_Discovery.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_Extension_Discovery.verified.txt
@@ -166,7 +166,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IRepository_string__GetById_M0_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((int)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
@@ -236,7 +236,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IRepository_string__Save_M1_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((string)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Class_Type_Argument.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Class_Type_Argument.verified.txt
index e216d9570d..df55149d05 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Class_Type_Argument.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Class_Type_Argument.verified.txt
@@ -149,7 +149,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public Sandbox_IFoo_Sandbox_Bar__Process_M1_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((global::Sandbox.Bar)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Multiple_Non_Builtin_Type_Arguments.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Multiple_Non_Builtin_Type_Arguments.verified.txt
index 2766fa1f4d..3f17e163f4 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Multiple_Non_Builtin_Type_Arguments.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Multiple_Non_Builtin_Type_Arguments.verified.txt
@@ -143,7 +143,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public Sandbox_IMapper_Sandbox_Entity_Sandbox_Status__Map_M0_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((global::Sandbox.Entity)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Nested_Namespace_Type_Argument.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Nested_Namespace_Type_Argument.verified.txt
index 199200a7fd..1d1f0b1cee 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Nested_Namespace_Type_Argument.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Generic_Interface_With_Nested_Namespace_Type_Argument.verified.txt
@@ -149,7 +149,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public Sandbox_IService_Outer_Inner_Config__Apply_M1_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((global::Outer.Inner.Config)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_Inheriting_Multiple_Interfaces.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_Inheriting_Multiple_Interfaces.verified.txt
index 4804dd3118..2bcae59aa1 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_Inheriting_Multiple_Interfaces.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_Inheriting_Multiple_Interfaces.verified.txt
@@ -165,7 +165,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IReadWriter_Write_M2_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((string)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Async_Methods.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Async_Methods.verified.txt
index 5d526cb8d7..ee1bc297d7 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Async_Methods.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Async_Methods.verified.txt
@@ -260,7 +260,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IAsyncService_GetValueAsync_M0_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((string)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
@@ -415,7 +415,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IAsyncService_ComputeAsync_M2_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((int)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
@@ -492,7 +492,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IAsyncService_InitializeAsync_M3_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((global::System.Threading.CancellationToken)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Events.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Events.verified.txt
index c33be9fb39..ac17e57599 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Events.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Events.verified.txt
@@ -195,7 +195,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public INotifier_Notify_M0_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((string)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Keyword_Parameter_Names.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Keyword_Parameter_Names.verified.txt
index edf7852f03..887078a01a 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Keyword_Parameter_Names.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Keyword_Parameter_Names.verified.txt
@@ -171,7 +171,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public ITest_Test_M0_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((string)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
@@ -251,7 +251,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public ITest_Get_M1_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((int)args[0]!, (string)args[1]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Mixed_Members.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Mixed_Members.verified.txt
index 3929abc96c..9e5754d76c 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Mixed_Members.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Mixed_Members.verified.txt
@@ -274,7 +274,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IService_GetAsync_M3_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((int)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
@@ -347,7 +347,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IService_Process_M4_MockCall Callback(global::System.Action callback)
{
- EnsureSetup().Callback(args => callback((string)args[0]!));
+ EnsureSetup().Callback(callback);
return this;
}
diff --git a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Nullable_Reference_Type_Parameters.verified.txt b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Nullable_Reference_Type_Parameters.verified.txt
index 7ec88b80ea..251905ed22 100644
--- a/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Nullable_Reference_Type_Parameters.verified.txt
+++ b/TUnit.Mocks.SourceGenerator.Tests/Snapshots/Interface_With_Nullable_Reference_Type_Parameters.verified.txt
@@ -288,7 +288,7 @@ namespace TUnit.Mocks.Generated
/// Execute a typed callback using the actual method parameters.
public IFoo_Bar_M0_MockCall Callback(global::System.Action