2014-04-28 08:17:05 +08:00
|
|
|
package neurosky
|
2014-04-26 18:11:51 +08:00
|
|
|
|
|
|
|
import (
|
2014-06-14 04:40:24 +08:00
|
|
|
"testing"
|
2014-07-23 09:00:54 +08:00
|
|
|
|
|
|
|
"github.com/hybridgroup/gobot"
|
2014-04-26 18:11:51 +08:00
|
|
|
)
|
|
|
|
|
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-04-26 18:11:51 +08:00
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestNeuroskyAdaptorConnect(t *testing.T) {
|
|
|
|
a := initTestNeuroskyAdaptor()
|
2014-07-18 02:41:47 +08:00
|
|
|
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)
|
|
|
|
}
|