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