goadb/adb/adb_test.go

23 lines
386 B
Go
Raw Normal View History

package adb
import (
"testing"
2020-10-29 02:18:51 +00:00
"github.com/evrins/goadb/wire"
2020-07-13 06:18:10 +00:00
"github.com/stretchr/testify/assert"
)
func TestGetServerVersion(t *testing.T) {
s := &MockServer{
Status: wire.StatusSuccess,
Messages: []string{"000a"},
}
client := &Adb{s}
v, err := client.ServerVersion()
assert.Equal(t, "host:version", s.Requests[0])
assert.NoError(t, err)
assert.Equal(t, 10, v)
}