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 ChildEndsWhenRepeaterEnds() { var repeater = new RepeaterInfinite(true); var childNode = new EventTrackingNode(NodeState.Successful); repeater.Child = childNode; repeater.Start(); repeater.Update(); repeater.Update(); repeater.Update(); repeater.End(); Assert.IsTrue(childNode.HasEnded); }
public void ChildSuccess() { var repeater = new RepeaterInfinite(); var childNode = new EventTrackingNode(NodeState.Inactive); repeater.Child = childNode; repeater.Start(); repeater.Update(); repeater.Update(); childNode.SetStatusOnNextUpdate(NodeState.Successful); repeater.Update(); Assert.AreEqual(NodeState.Successful, repeater.Status); Assert.AreEqual(3, childNode.UpdatesTotal); Assert.AreEqual(true, childNode.HasEnded); }
public void StartChild() { var repeater = new RepeaterInfinite(); var childNode = new EventTrackingNode(NodeState.Inactive); repeater.Child = childNode; repeater.Start(); repeater.Update(); Assert.AreEqual(true, childNode.HasStarted); }
public void ChildStartsWhenRepeaterUpdatesFirstTime() { var repeater = new RepeaterInfinite(); var childNode = new EventTrackingNode(NodeState.Error); repeater.Child = childNode; repeater.Start(); repeater.Update(); Assert.IsTrue(childNode.HasStarted); Assert.AreEqual(1, childNode.StartsTotal); }
public void ChildMissing() { //arrange var repeater = new RepeaterInfinite(); var nodeStatus = NodeState.Inactive; //act repeater.Start(); repeater.Update(); nodeStatus = repeater.Status; //assert Assert.AreEqual(NodeState.Error, nodeStatus); }
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); }