hybridgroup.gobot/platforms/digispark/digispark_adaptor_test.go

33 lines
709 B
Go
Raw Normal View History

2014-04-28 19:23:15 +08:00
package digispark
import (
2014-06-13 07:15:06 +08:00
"github.com/hybridgroup/gobot"
"testing"
)
2014-06-14 07:01:39 +08:00
func initTestDigisparkAdaptor() *DigisparkAdaptor {
a := NewDigisparkAdaptor("bot")
a.connect = func(a *DigisparkAdaptor) {}
return a
2014-06-13 07:15:06 +08:00
}
2014-06-14 07:01:39 +08:00
func TestDigisparkAdaptorFinalize(t *testing.T) {
a := initTestDigisparkAdaptor()
gobot.Assert(t, a.Finalize(), true)
2014-06-13 07:15:06 +08:00
}
2014-06-14 07:01:39 +08:00
func TestDigisparkAdaptorConnect(t *testing.T) {
a := initTestDigisparkAdaptor()
gobot.Assert(t, a.Connect(), true)
2014-06-13 07:15:06 +08:00
}
2014-06-14 07:01:39 +08:00
func TestDigisparkAdaptorDisconnect(t *testing.T) {
a := initTestDigisparkAdaptor()
gobot.Assert(t, a.Disconnect(), true)
2014-06-13 07:15:06 +08:00
}
2014-06-14 07:01:39 +08:00
func TestDigisparkAdaptorReconnect(t *testing.T) {
a := initTestDigisparkAdaptor()
gobot.Assert(t, a.Reconnect(), true)
2014-06-13 07:15:06 +08:00
}