Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArgumentException : Object of type 'Microsoft.DurableTask.TaskName' cannot be converted to type 'System.String' #1343

Closed
waele opened this issue May 16, 2023 · 1 comment

Comments

@waele
Copy link

waele commented May 16, 2023

Hello,

I'm trying to mock TaskOrchestrationContext and I'm mocking the CallActivityAsync method:
_mainMock.Setup(x => x.CallActivityAsync
(GET_ENTITY_LOCK, It.IsAny(), It.IsAny()).Result)
.Returns<string, Dto, TaskOptions>((name, entity, options) => _controller.GetEntityLock(entity).Result);

I got this error:
Message: 
System.ArgumentException : Object of type 'Microsoft.DurableTask.TaskName' cannot be converted to type 'System.String'.

Stack Trace: 
RuntimeType.CheckValue(Object& value, ParameterCopyBackAction& copyBack, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
MethodBase.CheckArguments(Span1 copyOfParameters, IntPtr* byrefParameters, Span1 shouldCopyBack, ReadOnlySpan1 parameters, RuntimeType[] sigTypes, Binder binder, CultureInfo culture, BindingFlags invokeAttr) RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) Delegate.DynamicInvokeImpl(Object[] args) Extensions.InvokePreserveStack(Delegate del, IReadOnlyList1 args) line 158
<>c__DisplayClass23_0.b__2(IInvocation invocation) line 269
ReturnComputedValue.Execute(Invocation invocation) line 22
MethodCall.ExecuteCore(Invocation invocation) line 110
Setup.Execute(Invocation invocation) line 71

Can you help me figure out the issue?
Thanks a lot!

@waele
Copy link
Author

waele commented May 17, 2023

Never mind I got the problem

@waele waele closed this as completed May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant