private void InitiallizeFSM() { root = new TestFSMRoot(); state1 = new TestFSMState1(); state2 = new TestFSMState2(); state3 = new TestFSMState3(); root.AddState(state1); root.AddState(state2); root.AddState(state3); TestRunnerHelper.Reset(); }
public IEnumerator Add() { root = new TestFSMRoot(); state1 = new TestFSMState1(); state2 = new TestFSMState2(); state3 = new TestFSMState3(); Assert.AreEqual(false, root.AddState(null)); Assert.AreEqual(true, root.AddState(state1)); Assert.AreEqual(ETestRunenrEnum.Test1, root.CurrentState.ID); Assert.AreEqual(true, root.AddState(state2)); Assert.AreEqual(true, root.AddState(state3)); Assert.AreEqual(ETestRunenrEnum.Test1, root.CurrentState.ID); TestFSMState1 sameState1 = new TestFSMState1(); Assert.AreEqual(false, root.AddState(sameState1)); Assert.AreEqual(3, root.StateCount); yield return(null); }