Mocking Action<T> with NSubstitute
问题 A proxy for a webservice needs unit testing without - obviously - hitting the web service. This is the method I'd like to neuter - public void Invoke(Action<T> action) { Task.Run(async ()=> { await _invoker.Invoke(this, action); }).Wait(); } Is there any way to mock the Action parameter using NSubstitute? I've been working along the lines of using _proxy.When(x => x.Invoke($args_go_here)).Do(x => _counter++); but I'm having real troubles formulating the Args expressions. If I could simply