mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-27 10:33:11 +01:00
28 lines
553 B
Go
28 lines
553 B
Go
|
package peer
|
||
|
|
||
|
import (
|
||
|
"github.com/magiconair/properties/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestConnStatus_String(t *testing.T) {
|
||
|
|
||
|
tables := []struct {
|
||
|
name string
|
||
|
status ConnStatus
|
||
|
want string
|
||
|
}{
|
||
|
{"StatusConnected", StatusConnected, "Connected"},
|
||
|
{"StatusDisconnected", StatusDisconnected, "Disconnected"},
|
||
|
{"StatusConnecting", StatusConnecting, "Connecting"},
|
||
|
}
|
||
|
|
||
|
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")
|
||
|
})
|
||
|
}
|
||
|
|
||
|
}
|