public void IgnoreChildSuccess() { var repeater = new RepeaterInfinite(true); var childNode = new AdjustableStateNode(NodeState.Inactive); repeater.Child = childNode; repeater.Start(); repeater.Update(); childNode.SetStatusOnNextUpdate(NodeState.Successful); repeater.Update(); Assert.AreEqual(NodeState.Active, repeater.Status); }
public void EndOnChildError() { var repeater = new RepeaterInfinite(); var childNode = new AdjustableStateNode(NodeState.Inactive); repeater.Child = childNode; repeater.Start(); repeater.Update(); childNode.SetStatusOnNextUpdate(NodeState.Error); repeater.Update(); Assert.AreEqual(NodeState.Error, repeater.Status); }
public void ChildActive() { var repeater = new RepeaterInfinite(); var childNode = new AdjustableStateNode(NodeState.Inactive); repeater.Child = childNode; var status = NodeState.Error; var count = 1; repeater.Start(); childNode.SetStatusOnNextUpdate(NodeState.Active); for (; count < 1000; count++) { repeater.Update(); status = repeater.Status; if (status != NodeState.Active) { break; } } Assert.AreEqual(1000, count); }