public void ResumingSelector_stops_when_encountering_a_success_node() { var callCount = new int[1]; var counter = Mocks.FailCounterNode(callCount); var sequence = ResumingSelector.Node(counter, counter, Mocks.AlwaysSucceedsNode, counter); BehaviorTree.Run(sequence, Mocks.EmptyDictionary).ShouldEqual(NodeStatus.Success); callCount[0].ShouldEqual(2); }
public void Selector_continues_past_failing_nodes() { var callCount = new int[1]; var counter = Mocks.FailCounterNode(callCount); var sequence = Selector.Node(counter, counter, counter, counter); BehaviorTree.Run(sequence, Mocks.EmptyDictionary).ShouldEqual(NodeStatus.Failure); callCount[0].ShouldEqual(4); }
public void ResumingSelector_returns_failure_with_multiple_failing_nodes() { var callCount = new int[1]; var counter = Mocks.FailCounterNode(callCount); var sequence = ResumingSelector.Node(counter, counter, counter, counter, counter); BehaviorTree.Run(sequence, Mocks.EmptyDictionary).ShouldEqual(NodeStatus.Failure); callCount[0].ShouldEqual(5); }
public void Selector_stops_at_running_nodes() { var callCount = new int[1]; var counter = Mocks.FailCounterNode(callCount); var sequence = Selector.Node(counter, counter, counter, Mocks.AlwaysRunningNode, counter); BehaviorTree.Run(sequence, Mocks.EmptyDictionary).ShouldEqual(NodeStatus.Running); callCount[0].ShouldEqual(3); }