You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
383 B

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()))
}