class and method
public class A
{
public static bool TryGet<
T
>(string key, out T obj)
{
....
}
}
usage
public
static
object
AMethod(
string
key)
{
object
values;
if
(A.TryGet(key,
out
values))
{
return
values;
}
return
null
;
}
now i want to write a test for method AMethod and mock A.TryGet. How can I do that? I tried different approaches, but wasnt able to create a mock of the TryGet extension. I want to set the "obj" variable in the "TryGet" method do different values depending on the passed key (using "Returns" or "DoInstead")