public void When_running_then_complete_until_sucess_or_failure() { var s = new RandomSelector(new Helper().RunningTwiceThenSuccess(), new Helper().RunningTwiceThenSuccess(), new Helper().RunningTwiceThenSuccess()); s.Behave(); s.Behave(); s.Behave(); Assert.AreEqual(BehaviourReturnCode.Success, s.ReturnCode); }
public void When_completed_then_new_task_starts() { var s = new RandomSelector(new Helper().RunningTwiceThenSuccess(), new Helper().RunningTwiceThenSuccess(), new Helper().RunningTwiceThenSuccess()); s.Behave(); s.Behave(); s.Behave(); s.Behave(); Assert.AreEqual(BehaviourReturnCode.Running, s.ReturnCode); }
public void test_1(){ _log.enterScope (); RandomSelector rs = new RandomSelector (new BehaviorAction(component_1), new BehaviorAction(component_2), new BehaviorAction(component_3), new BehaviorAction(component_4)); for (int i = 0; i < 100000; i++) rs.Behave (); _log.logMessage ("1:" + counts[0] +", 2:" + counts[1]+ ", 3:" + counts[2]+ ", 4:" + counts [3]); Verify.VerifyTrue ("verify last component actioned", true, counts [3] > 0); _log.exitScope (); }
public void test_1() { _log.enterScope(); RandomSelector rs = new RandomSelector(new BehaviorAction(component_1), new BehaviorAction(component_2), new BehaviorAction(component_3), new BehaviorAction(component_4)); for (int i = 0; i < 100000; i++) { rs.Behave(); } _log.logMessage("1:" + counts[0] + ", 2:" + counts[1] + ", 3:" + counts[2] + ", 4:" + counts [3]); Verify.VerifyTrue("verify last component actioned", true, counts [3] > 0); _log.exitScope(); }