try the below production code:
public interface BuildInterface
{
bool CanContinue(out string str);
}
public class TestBuildInterface
{
public BuildInterface build
{ get; private set; }
public TestBuildInterface(BuildInterface bb)
{
build = bb;
}
public int Looping()
{
for (int i = 0; i < 10; i++)
{
string str;
if(!build.CanContinue(out str))
return i;
}
return -1;
}
}
and the following test code
[Test]
public void TestBuildtest()
{
var build = Isolate.Fake.Instance<BuildInterface>();
var str = "";
Isolate.WhenCalled(()=>build.CanContinue(out str))
.WillReturn(true);
Isolate.WhenCalled(() => build.CanContinue(out str))
.WillReturn(false);
var buildTest = new TestBuildInterface(build);
var loopInt = buildTest.Looping();
Assert.AreEqual(1, loopInt);
}
The test fails, even though it should
________
Yamaha gx1