hybridgroup.gobot/platforms/neurosky/neurosky_adaptor_test.go

27 lines
514 B
Go
Raw Normal View History

2014-04-28 08:17:05 +08:00
package neurosky
import (
2014-06-14 04:40:24 +08:00
"testing"
2014-07-23 09:00:54 +08:00
"github.com/hybridgroup/gobot"
)
2014-06-14 07:01:39 +08:00
func initTestNeuroskyAdaptor() *NeuroskyAdaptor {
2014-07-23 09:00:54 +08:00
a := NewNeuroskyAdaptor("bot", "/dev/null")
a.connect = func(n *NeuroskyAdaptor) {
n.sp = gobot.NullReadWriteCloser{}
}
return a
2014-06-14 04:40:24 +08:00
}
2014-06-14 07:01:39 +08:00
func TestNeuroskyAdaptorConnect(t *testing.T) {
a := initTestNeuroskyAdaptor()
gobot.Assert(t, a.Connect(), true)
2014-06-14 04:40:24 +08:00
}
2014-07-23 09:00:54 +08:00
func TestNeuroskyAdaptorFinalize(t *testing.T) {
a := initTestNeuroskyAdaptor()
a.Connect()
gobot.Assert(t, a.Finalize(), true)
}