2
我有一个我需要模拟的接口,其索引属性部分看起来像这样。如何使用MS Fakes创建索引属性的存根
public interface MyInterface{
string this[string name] {get;set;};
string this[int index] {get;set;};
}
我想嘲笑接口,以便上面的名称和索引的某些值返回我提供的值。我如何通过Microsoft Fakes Framework实现这一目标?
这应该被标记为答案,因为这是正确的。感谢Joshua的详细解答! – Erica 2014-08-01 17:52:43