add support for multiple source states in transitions
This commit is contained in:
parent
e533a67303
commit
1835255b6d
@ -61,3 +61,14 @@ func TestTransitionSubscribe(t *testing.T) {
|
||||
t.Errorf("Invalid enter event")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTransitionMultipleSourceStates(t *testing.T) {
|
||||
tr := NewTransition("open", States("closed", "disconnected"), "opened")
|
||||
assert.NotNil(t, tr)
|
||||
mc := setupModel("closed")
|
||||
assert.Nil(t, tr.Run(mc))
|
||||
assert.Equal(t, "opened", string(mc.InspectState()))
|
||||
md := setupModel("disconnected")
|
||||
assert.Nil(t, tr.Run(md))
|
||||
assert.Equal(t, "opened", string(md.InspectState()))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user