Hello,
I'm trying to do the following:
The problem is that b is always empty. How can I get the value? I've checking the Arg.OutRefResult class but the documentation does not say anything about it.
Thanks.
I'm trying to do the following:
[TestClass]
public
class
JustMockTest
{
[TestMethod]
public
void
TestMethod()
{
Mock.SetupStatic(
typeof
(Real));
IntPtr test;
Mock.Arrange(() => Real.RealMethod(Arg.IsAny<
int
>(),
out
test)).IgnoreArguments().Returns((
int
a, IntPtr b) => Fake.FakeMethod(a,
out
b));
IntPtr expected;
int
result = Real.RealMethod(1,
out
expected);
}
}
public
static
class
Real
{
public
static
int
RealMethod(
int
a,
out
IntPtr b)
{
b =
new
IntPtr(222);
return
a*2;
}
}
public
static
class
Fake
{
public
static
int
FakeMethod(
int
a,
out
IntPtr b)
{
b =
new
IntPtr(111);
return
a * 4;
}
}
The problem is that b is always empty. How can I get the value? I've checking the Arg.OutRefResult class but the documentation does not say anything about it.
Thanks.