2014-05-02 17:22:05 -05:00
|
|
|
package pebble
|
|
|
|
|
|
|
|
import (
|
2014-06-13 14:18:57 -07:00
|
|
|
"testing"
|
2014-11-28 18:10:05 -08:00
|
|
|
|
2023-10-20 10:27:09 +02:00
|
|
|
"github.com/stretchr/testify/assert"
|
2023-05-20 14:25:21 +02:00
|
|
|
"gobot.io/x/gobot/v2"
|
2014-05-02 17:22:05 -05:00
|
|
|
)
|
|
|
|
|
2016-10-01 18:01:30 +02:00
|
|
|
var _ gobot.Adaptor = (*Adaptor)(nil)
|
2016-07-13 11:01:36 -06:00
|
|
|
|
2016-10-01 18:01:30 +02:00
|
|
|
func initTestAdaptor() *Adaptor {
|
|
|
|
return NewAdaptor()
|
2014-06-13 14:18:57 -07:00
|
|
|
}
|
2014-05-02 17:22:05 -05:00
|
|
|
|
2016-10-01 18:01:30 +02:00
|
|
|
func TestAdaptor(t *testing.T) {
|
|
|
|
a := initTestAdaptor()
|
2023-10-20 10:27:09 +02:00
|
|
|
assert.Equal(t, "Pebble", a.Name())
|
2014-12-17 14:04:18 -08:00
|
|
|
}
|
2016-10-01 18:01:30 +02:00
|
|
|
func TestAdaptorConnect(t *testing.T) {
|
|
|
|
a := initTestAdaptor()
|
2023-10-20 10:27:09 +02:00
|
|
|
assert.Nil(t, a.Connect())
|
2014-06-13 14:18:57 -07:00
|
|
|
}
|
2014-06-13 16:01:39 -07:00
|
|
|
|
2016-10-01 18:01:30 +02:00
|
|
|
func TestAdaptorFinalize(t *testing.T) {
|
|
|
|
a := initTestAdaptor()
|
2023-10-20 10:27:09 +02:00
|
|
|
assert.Nil(t, a.Finalize())
|
2014-06-13 14:18:57 -07:00
|
|
|
}
|