2022-01-21 13:52:19 +01:00
|
|
|
package peer
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/magiconair/properties/assert"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestConnStatus_String(t *testing.T) {
|
|
|
|
|
|
|
|
tables := []struct {
|
|
|
|
name string
|
|
|
|
status ConnStatus
|
|
|
|
want string
|
|
|
|
}{
|
2022-07-05 19:47:50 +02:00
|
|
|
{"StatusConnected", StatusConnected, "Connected"},
|
|
|
|
{"StatusDisconnected", StatusDisconnected, "Disconnected"},
|
|
|
|
{"StatusConnecting", StatusConnecting, "Connecting"},
|
2022-01-21 13:52:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, table := range tables {
|
|
|
|
t.Run(table.name, func(t *testing.T) {
|
|
|
|
got := table.status.String()
|
|
|
|
assert.Equal(t, got, table.want, "they should be equal")
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|