Hi
To mock an indexer use Mock.ExpectGetIndex method
example:
class TestedClass
{
public string this[int index]
{
//we are mocking the getter implementation is not important here
get { throw new NotImplementedException(); }
}
}
[TestFixture]
public class TestClass
{
[Test]
public void Test()
{
Mock mock = MockManager.Mock(typeof (TestedClass));
mock.ExpectGetIndex("abc");
TestedClass c = new TestedClass();
Assert.AreEqual("abc", c[0]);
}
}
Hope it helps