relation_test.go 383 B

12345678910111213141516
  1. package fsm
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestRelationStateMachine(t *testing.T) {
  7. rs := NewRelationStateMachine(StateNoRelation, DefaultHandler)
  8. assert.NotNil(t, rs)
  9. assert.Equal(t, RelationState(rs.Current()), StateNoRelation)
  10. assert.NoError(t, rs.Event(EventAddFollowing))
  11. assert.Equal(t, StateFollowing, RelationState(rs.Current()))
  12. }