Rhinos telling me that Arg <T> inside AssertWasCalled needs extra arguments?

here is the call inside [Test]

_youTubeService.AssertWasCalled(d => d.GetFeedByAuthorWithRequest("Mark", Arg<YouTubeRequest>.Is.Anything)); 

here is the interface function for youtubeService:

 Feed<Video> GetFeedByAuthorWithRequest(string author, YouTubeRequest request) 

Here the Rhino Mocks error gives me when I run the test:

System.InvalidOperationException: when using Arg, all arguments must be defined using Arg.Is, Arg.Text, Arg.List, Arg.Ref or Arg.Out. 2 arguments expected, 1 defined.

I use Arg.Is.Anything all the time with other types, usually strings, so I'm not sure what else is needed.

+6
source share
1 answer

The exception message tells you what's wrong: all arguments must be specified using Arg ....

You need to specify the Mark Arg.Is with Arg.Is or Arg.Text or another static Arg method.

+10
source

Source: https://habr.com/ru/post/908473/


All Articles