gobot.io/x/gobot/v2@v2.1.0/platforms/ble/ble_client_adaptor_test.go (about) 1 package ble 2 3 import ( 4 "strings" 5 "testing" 6 7 "gobot.io/x/gobot/v2" 8 "gobot.io/x/gobot/v2/gobottest" 9 ) 10 11 var _ gobot.Adaptor = (*ClientAdaptor)(nil) 12 13 func initTestBLEClientAdaptor() *ClientAdaptor { 14 a := NewClientAdaptor("D7:99:5A:26:EC:38") 15 return a 16 } 17 18 func TestBLEClientAdaptor(t *testing.T) { 19 a := NewClientAdaptor("D7:99:5A:26:EC:38") 20 gobottest.Assert(t, a.Address(), "D7:99:5A:26:EC:38") 21 gobottest.Assert(t, strings.HasPrefix(a.Name(), "BLEClient"), true) 22 } 23 24 func TestBLEClientAdaptorName(t *testing.T) { 25 a := NewClientAdaptor("D7:99:5A:26:EC:38") 26 a.SetName("awesome") 27 gobottest.Assert(t, a.Name(), "awesome") 28 }