I have a test method:
public class MyTests
{
[Fact]
public void Test_Method()
{
// Arrange
var returns = Result.Ok(new List<string>() { "Test" }.AsEnumerable());
this.mockService.ServiceMethod(Arg.Any<Guid>()).Returns(returns); //returns Result<IEnumerable<string>>
//Act
var actResult = this.anotherService.Backup();
//Assert
Assert.True(actResult.Success);
}
...
To test this method:
public class AnotherService
{
internal Result Backup()
{
var ret = this.mockService.ServiceMethod().Value;
...
return Result.Ok();
}
When I run the method only for Test_Method()
everything happens fine. When I try to run for the entire MyTests
class I get the following error on this refer method:
NSubstitute.Exceptions.AmbiguousArgumentsException: 'Cannot determine argument specifications to use. Please use specifications for all arguments of the same type.'
I believe this problem has nothing to do with this scenario: How NOT to use argument matchers
NSubstitute.Analyzers:
Is there anything to do?