So, I'm trying to use Microsoft Fakes, and I like it, but I have a static method with an out parameter, and I can't figure out how to use it:
Static fake method:
public static class Foo
{
public static bool TryBar(string str, out string stuff)
{
stuff = str;
return true;
}
}
Test:
[TestFixture]
public class MyTestTests
{
[Test]
public void MyTest()
{
using (ShimsContext.Create())
{
string output;
ShimFoo.TryBarStringStringOut = (input, out output) =>
{
output = "Yada yada yada";
return false;
};
}
}
}
Now I get an error in my test, claiming that my output parameter is incorrect ("Cannot resolve character output"). I tried to get documentation on how to handle parameters, but I can not find anything. Has anyone had experience?
source
share