I use NUnit and NSubstitute for unit testing. I have the following:
public interface IDataProvider
{
void Log(int tvmId, DateTime time, int source, int level, int eventCode, string message);
}
...
var fakeDataProvider = Substitute.For<IDataProvider>();
...
fakeDataProvider.Received().Log(
Arg.Any<int>(),
new DateTime(2000, 1, 1),
0,
0,
0,
null);
fakeDataProvider.Received() throws AmbiguousArgumentException with the message that it cannot determine argument specifications to use. I have found the following on SO
Cannot determine argument specifications to use
which is related but I cannot apply it in the code above. Why is the above code ambiguous? How else could I specify to Received() that it should accept any argument?