1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00
hybridgroup.gobot/platforms/ble/ble_client_adaptor_test.go

29 lines
618 B
Go
Raw Normal View History

2015-06-07 12:38:19 -07:00
package ble
import (
"strings"
2015-06-07 12:38:19 -07:00
"testing"
"gobot.io/x/gobot"
"gobot.io/x/gobot/gobottest"
2015-06-07 12:38:19 -07:00
)
var _ gobot.Adaptor = (*ClientAdaptor)(nil)
func initTestBLEClientAdaptor() *ClientAdaptor {
a := NewClientAdaptor("D7:99:5A:26:EC:38")
2015-06-07 12:38:19 -07:00
return a
}
func TestBLEClientAdaptor(t *testing.T) {
a := NewClientAdaptor("D7:99:5A:26:EC:38")
gobottest.Assert(t, a.Address(), "D7:99:5A:26:EC:38")
gobottest.Assert(t, strings.HasPrefix(a.Name(), "BLEClient"), true)
}
func TestBLEClientAdaptorName(t *testing.T) {
a := NewClientAdaptor("D7:99:5A:26:EC:38")
a.SetName("awesome")
gobottest.Assert(t, a.Name(), "awesome")
2015-06-07 12:38:19 -07:00
}