Unit testing using Mock in MVC
<p>I am trying to implement an unit test for a method in my class. How could I mock a base class indexer on the class method I am testing? Below code snippet should give a clear picture of my requirement.</p>

<pre><code>public class MyClass:MyBase
{
  public string returnString(string str1)
  {
     var xyz=base[str1];
     //My code to unit test is here
  }
}

public class MyBase
{
  public virtual string this[string str1]
  {
     return "prefix"+str1;
  }
}
</code></pre>

<p>I would like to stub my base class indexer with a dummy string and test my actual code. How can I do that?
Thanks for any help on this in advance.</p>

<p>Sree.</p>