2015-04-11 21:45:29 +00:00
|
|
|
package goadb
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/zach-klippenstein/goadb/wire"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGetServerVersion(t *testing.T) {
|
2015-04-12 20:34:20 +00:00
|
|
|
s := &MockServer{
|
2015-04-11 21:45:29 +00:00
|
|
|
Status: wire.StatusSuccess,
|
|
|
|
Messages: []string{"000a"},
|
2015-04-12 20:34:20 +00:00
|
|
|
}
|
2016-01-10 21:33:22 +00:00
|
|
|
client := NewHostClient(s)
|
2015-04-11 21:45:29 +00:00
|
|
|
|
|
|
|
v, err := client.GetServerVersion()
|
2015-04-12 20:34:20 +00:00
|
|
|
assert.Equal(t, "host:version", s.Requests[0])
|
2015-04-11 21:45:29 +00:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, 10, v)
|
|
|
|
}
|