go-common/app/job/main/relation/fsm/relation_test.go

17 lines
383 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
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()))
}