goadb/host_client_test.go

22 lines
410 B
Go
Raw Normal View History

package goadb
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/zach-klippenstein/goadb/wire"
)
func TestGetServerVersion(t *testing.T) {
s := &MockServer{
Status: wire.StatusSuccess,
Messages: []string{"000a"},
}
client := NewHostClient(s)
v, err := client.GetServerVersion()
assert.Equal(t, "host:version", s.Requests[0])
assert.NoError(t, err)
assert.Equal(t, 10, v)
}