NSubstitute does not support automatic configuration of multiple instances of a common method.
As we usually see, the IInstanceSource used in the test is to configure it for specific code of the tested code, so T will be known. If one tool should work for several different T s, we could simplify the configuration using a helper method, for example ConfigureInstanceSource<T>() , which will perform configuration steps for a specific T
In your case, although it seems that you want a fixed behavior for all fake IInstanceSource instances, in which case I believe that you did the right thing by manually encoding your own double test.
source share