1
我有以下接口:如何用NSubstitute模拟一个带数组参数的方法?
interface IText
{
void CopyTo(char[] array, int index);
}
我想创建实施IText
这台array[index]='f'
,array[index+1]='o'
,array[index+2]='o'
模仿对象时CopyTo
被调用。
NSubstitute可能吗?如果是这样,怎么样?
注:'IText'必须是公共使用NSubstitute和其他基于代理的动态嘲讽库来代替。 –
@DavidTchepak:或者使用[assembly:InternalsVisibleTo(“DynamicProxyGenAssembly2”)] – cm007