Closed AdisonCavani closed 2 years ago
Hello @AdisonCavani thank you for your feedback.
savedObj
is null because in .Returns((WebJobStatus model, CancellationToken token) => Task.FromResult((EntityEntry<WebJobStatus>)null));
you defined to return null
for result of any AddAsync
operation. You need to receive result from AddAsync not equal to null
you have to define it in .Returns...
To make it work you can just do it according to the answer.
I need to mock
AddAsync(obj)
function. I have seen this stackoverflow topic, but proposed code:will return null
EntityEntry<WebJobStatus>
which will cause to fail my unit test.Function I want to test:
Error:
savedObj
is null