public void SetTransitionsError() { var errorManager = new ParserErrorManager(); this.fsm.ErrorManager = errorManager; this.fsm.Build(); Assert.AreEqual(2, errorManager.Errors.Count()); }
public void NoInitialState_SetTransitionsErrorTypes() { var errorManager = new ParserErrorManager(); this.fsm.ErrorManager = errorManager; this.fsm.Build(); var errors = errorManager.Errors.ToArray(); Assert.AreEqual("Initial state (null) is not concrete.", errors[0]); Assert.AreEqual("Aborting due to inconsistent input.", errors[1]); }
public void SetDuplicantEventsTypes() { var errorManager = new ParserErrorManager(); this.fsm.ErrorManager = errorManager; this.fsm.AddBuiltConcreteState(new ConcreteStateImpl("State1")); this.fsm.AddBuiltConcreteState(new ConcreteStateImpl("State2")); this.fsm.SetError(); this.fsm.SetInitialState("State1"); this.fsm.AddTransition("Event", "State2", null); this.fsm.AddTransition("Event", "State2", null); this.fsm.AddTransition("Event", "State2", null); this.fsm.AddTransition("Event", "State2", null); Assert.IsFalse(this.fsm.Build()); Assert.AreEqual(1, errorManager.Errors.Count()); }