go-common/app/job/main/relation/fsm/relation_test.go
2019-04-22 18:49:16 +08:00

17 lines
383 B
Go

package fsm
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRelationStateMachine(t *testing.T) {
rs := NewRelationStateMachine(StateNoRelation, DefaultHandler)
assert.NotNil(t, rs)
assert.Equal(t, RelationState(rs.Current()), StateNoRelation)
assert.NoError(t, rs.Event(EventAddFollowing))
assert.Equal(t, StateFollowing, RelationState(rs.Current()))
}