public void WhenChildReturnFailure_ReturnSuccess() { var child = new MockBehaviour { ReturnStatus = BehaviourStatus.Failed }; var sut = new UntilFailed <MockContext>(child); var behaviourStatus = sut.Tick(new MockContext()); Assert.That(behaviourStatus, Is.EqualTo(BehaviourStatus.Succeeded)); }
public void WhenChildReturnRunning_ReturnRunning() { var child = new MockBehaviour { ReturnStatus = BehaviourStatus.Running }; var sut = new UntilFailed <MockContext>(child); for (var i = 0; i < 10; i++) { var behaviourStatus = sut.Tick(new MockContext()); Assert.That(behaviourStatus, Is.EqualTo(BehaviourStatus.Running)); Assert.That(child.TerminateCallCount, Is.EqualTo(0)); } }
public void Visit(UntilFailed <TContext> obj) { PrintNode(obj); VisitChild(obj); }