0
Предположим, что у меня есть методMS Подделки: Проставки с заданным входом
public void SomeFunction (int a)
{
return AnotherFunction (a + 1);
}
Есть ли способ, чтобы Призонная шайба AnotherFunction с определенными параметрами? Я думаю о чем-то вроде:
using (ShimContext.Create())
{
ShimMyClass.AnotherFunctionInt = (3) => 34; // return 34 if the given value is 3
ShimMyClass.AnotherFunctionInt = (4) => 44; // return 44 if the given value is 4
ShimMyClass.AnotherFunctionInt = (a) => 22; // default value
}