I have an interface that is defined like this
public interface IFoo { object this[string key] { get; } }
How can I mock this indexer with NSubstitute?
Call the indexer, then use Returns :
Returns
var sub = Substitute.For<IFoo>(); sub["hello"].Returns("world");