Код: Выделить всё
public interface ISomeInterface
{
string this[string key] { get; }
}
Код: Выделить всё
Mock mock = new();
mock
.Setup(m => m[It.IsAny()]) //
Подробнее здесь: [url]https://stackoverflow.com/questions/79341824/how-to-mock-indexer-return-value-with-any-string-key-in-nsubstitute[/url]
Мобильная версия