2014-06-14 04:35:19 +08:00
|
|
|
package leap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hybridgroup/gobot"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func initTestLeapMotionAdaptor() *LeapMotionAdaptor {
|
2014-11-08 05:15:45 +08:00
|
|
|
a := NewLeapMotionAdaptor("bot", "")
|
2014-11-20 07:11:00 +08:00
|
|
|
a.connect = func(l *LeapMotionAdaptor) (err error) { return nil }
|
2014-11-08 05:15:45 +08:00
|
|
|
return a
|
2014-06-14 04:35:19 +08:00
|
|
|
}
|
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestLeapMotionAdaptorConnect(t *testing.T) {
|
|
|
|
a := initTestLeapMotionAdaptor()
|
2014-11-20 15:21:19 +08:00
|
|
|
gobot.Assert(t, len(a.Connect()), 0)
|
2014-06-14 04:35:19 +08:00
|
|
|
}
|
2014-06-14 07:01:39 +08:00
|
|
|
|
|
|
|
func TestLeapMotionAdaptorFinalize(t *testing.T) {
|
|
|
|
a := initTestLeapMotionAdaptor()
|
2014-11-20 15:21:19 +08:00
|
|
|
gobot.Assert(t, len(a.Finalize()), 0)
|
2014-06-14 04:35:19 +08:00
|
|
|
}
|