StatechartActive.sctunit 673 B

123456789101112131415161718192021222324252627282930313233
  1. testclass StatechartActive for statechart StatechartActive {
  2. /** A state machine must be inactive before it has been entered. */
  3. @Test
  4. operation inactiveBeforeEnter(){
  5. assert !is_active
  6. }
  7. /** A state machine must be active after it has been entered. */
  8. @Test
  9. operation activeAfterEnter(){
  10. enter
  11. assert is_active
  12. }
  13. /** A state machine must be inactive after it has been exited. */
  14. @Test
  15. operation inactiveAfterExit(){
  16. enter
  17. exit
  18. assert !is_active
  19. }
  20. /** A state machine must be active after it has been exited and reentered. */
  21. @Test
  22. operation activeAfterReenter(){
  23. enter
  24. exit
  25. enter
  26. assert is_active //false /* is_active */
  27. }
  28. }