public void TestDirectCount3ToFailure() { var obj = new CoroutineTestObject(); ITicker coroutine = new Regulus.BehaviourTree.Yield.Coroutine(() => obj.DirectCount3ToFailure()); var res1 = coroutine.Tick(0); var res2 = coroutine.Tick(0); var res3 = coroutine.Tick(0); var res4 = coroutine.Tick(0); var res5 = coroutine.Tick(0); Assert.AreEqual(TICKRESULT.RUNNING, res1); Assert.AreEqual(TICKRESULT.RUNNING, res2); Assert.AreEqual(TICKRESULT.RUNNING, res3); Assert.AreEqual(TICKRESULT.FAILURE, res4); Assert.AreEqual(TICKRESULT.RUNNING, res5); }
public void TestDirectNull() { var obj = new CoroutineTestObject(); ITicker coroutine = new Regulus.BehaviourTree.Yield.Coroutine(() => obj.DirectNull()); var res1 = coroutine.Tick(0); Assert.AreEqual(TICKRESULT.SUCCESS, res1); }
public void UntilCount3ToToSuccess() { var obj = new CoroutineTestObject(); ITicker coroutine = new Regulus.BehaviourTree.Yield.Coroutine(() => obj.UntilCount3ToSuccess()); var res1 = coroutine.Tick(0); var res2 = coroutine.Tick(0); var res3 = coroutine.Tick(0); var res4 = coroutine.Tick(0); var res5 = coroutine.Tick(0); var res6 = coroutine.Tick(0); Assert.AreEqual(TICKRESULT.RUNNING, res1); Assert.AreEqual(TICKRESULT.RUNNING, res2); Assert.AreEqual(TICKRESULT.RUNNING, res3); Assert.AreEqual(TICKRESULT.RUNNING, res4); Assert.AreEqual(TICKRESULT.RUNNING, res5); Assert.AreEqual(TICKRESULT.SUCCESS, res6); }