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 EndBeforeUpdate() { var repeater = new RepeaterInfinite(); var childNode = new EventTrackingNode(NodeState.Inactive); repeater.Child = childNode; repeater.Start(); repeater.End(); Assert.AreEqual(false, childNode.HasStarted); Assert.AreEqual(false, childNode.HasEnded); Assert.AreEqual(0, childNode.UpdatesTotal); }
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 ChildError() { var repeater = new RepeaterInfinite(); var childNode = new EventTrackingNode(NodeState.Inactive); repeater.Child = childNode; repeater.Start(); childNode.SetStatusOnNextUpdate(NodeState.Error); repeater.Update(); Assert.AreEqual(NodeState.Error, repeater.Status); Assert.AreEqual(true, childNode.HasEnded); }
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 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 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); }