Hello,
I searched through the forums but could not find any other topic related to my my problem. If this question has already been answered please redirect me to the link.
I am trying to fake a method with an 'out' parameter.
After reading the online developers documentation I wrote a small test similar to the following.
class ClassUnderTest
{
public bool GetCount(out int count)
{
count = -1;
return false;
}
}
[Test]
[Isolated]
public void Test()
{
int count = 100;
ClassUnderTest cut = Isolate.Fake.Instance<ClassUnderTest>();
Isolate.WhenCalled(() => cut.GetCount(out count)).WillReturn(true);
int countValue;
cut.GetCount(out countValue);
Assert.That(countValue, Is.EqualTo(100));
}
I would expect that this test would succeed but in fact it does not. The value returned in the out parameter is 0.
Can you please tell me what I might be doing wrong?
Thank you,
Darin