We can write the first test for your
State Machine object. Select a method on it, then choose inputs and the
output you expect, then write the test. I might try this:
TransitionTable transitionTable =
TransitionTable.withStartState("a")
.withTransition("a", 1, "b")
.withEndState("b");
StateMachine stateMachine = new StateMachine(transitionTable);
assertEquals("b", stateMachine.transition("a", 1));
assertTrue(statemAchine.isInEndState());
This is a simple test for a simple state machine.
浙公网安备 33010602011771号