NSubstitute - TestFixture 1 causa AmbiguousArgumentsException no TestFixture 2

Estou escrevendo testes de unidade em C # usando NUnit e NSubstitute. Estou testando uma classe que tentará recuperar objetos de um provedor de configuração implementando a seguinte interface:

public interface IConfigProvider<T> {
    T GetConfig(int id);
    T GetConfig(string id);
}

A classe que está sendo testada usa apenas a versão int doGetConfig portanto, no SetUpFixture, faço o seguinte para configurar um provedor de configuração simulado que sempre retornará o mesmo objeto fictício:

IConfigProvider<ConfigType> configProvider = Substitute.For<IConfigProvider<ConfigType>>();
configProvider.GetConfig(Arg.Any<int>()).Returns<ConfigType>(new ConfigType(/* args */);

Isso funciona absolutamente bem se esse TestFixture for o único a ser executado. No entanto, em um TestFixture diferente no mesmo assembly, verifico as chamadas recebidas assim:

connection.Received(1).SetCallbacks(Arg.Any<Action<Message>>(), Arg.Any<Action<long>>(), Arg.Any<Action<long, Exception>>());

Se estesReceived os testes são executados antes dos testes do provedor de configuração, os testes de configuração falham no SetUpFixture com uma AmbiguousArgumentsException:

Here.Be.Namespace.ProfileManagerTests+Setup (TestFixtureSetUp):
SetUp : NSubstitute.Exceptions.AmbiguousArgumentsException : Cannot determine argument specifications to use.
Please use specifications for all arguments of the same type.
at NSubstitute.Core.Arguments.NonParamsArgumentSpecificationFactory.Create(Object argument, IParameterInfo parameterInfo, ISuppliedArgumentSpecifications suppliedArgumentSpecifications)
at System.Linq.Enumerable.<SelectIterator>d__7`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at NSubstitute.Core.Arguments.MixedArgumentSpecificationsFactory.Create(IList`1 argumentSpecs, Object[] arguments, IParameterInfo[] parameterInfos)
at NSubstitute.Core.Arguments.ArgumentSpecificationsFactory.Create(IList`1 argumentSpecs, Object[] arguments, IParameterInfo[] parameterInfos, MatchArgs matchArgs)
at NSubstitute.Core.CallSpecificationFactory.CreateFrom(ICall call, MatchArgs matchArgs)
at NSubstitute.Routing.Handlers.RecordCallSpecificationHandler.Handle(ICall call)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at NSubstitute.Routing.Route.Handle(ICall call)
at NSubstitute.Proxies.CastleDynamicProxy.CastleForwardingInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.IConfigProvider`1Proxy.GetConfig(Int32 id)
at Here.Be.Namespace.ProfileManagerTests.Setup.DoSetup()

O que realmente me confunde é que eu posso observar esse efeito mesmo entre as execuções de teste - se eu usar a NUnit GUI para executar oReceived testes sozinho e, em seguida, execute os testes de configuração sozinho, os testes de configuração falharão. Se eu imediatamente executar os testes de configuração novamente, eles serão aprovados.

Coisas que tentei:

AdicionandoconfigProvider.GetConfig(Arg.Any<string>()).Returns... também, caso a sobrecarga fosse o problema.Eu li oDocumentos do NSubstitute sobre correspondência de argumentos, mas não consigo encontrar uma solução lá. Se for o caso de precisar fornecer correspondentes de argumento para as versões int e string do método, não consigo descobrir como fazer isso.

Por acaso, os testes que estou usando sempre chamam deGetConfig método com valores de 0 ou 1, para que eu possa fornecerReturns especificações para esses dois valores e não usar correspondência, mas quero entender como corrigir isso de maneira mais geral.

questionAnswers(3)

yourAnswerToTheQuestion