1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00
hybridgroup.gobot/platforms/pebble/pebble_driver_test.go

32 lines
711 B
Go
Raw Normal View History

2014-05-02 17:22:05 -05:00
package pebble
import (
2014-06-13 14:18:57 -07:00
"github.com/hybridgroup/gobot"
"testing"
2014-05-02 17:22:05 -05:00
)
2014-06-13 16:01:39 -07:00
func initTestPebbleDriver() *PebbleDriver {
return NewPebbleDriver(NewPebbleAdaptor("adaptor"), "pebble")
2014-06-13 14:18:57 -07:00
}
2014-06-13 16:01:39 -07:00
func TestPebbleDriverStart(t *testing.T) {
d := initTestPebbleDriver()
gobot.Assert(t, d.Start(), true)
2014-06-13 14:18:57 -07:00
}
2014-06-13 16:01:39 -07:00
func TestPebbleDriverHalt(t *testing.T) {
d := initTestPebbleDriver()
gobot.Assert(t, d.Halt(), true)
2014-06-13 14:18:57 -07:00
}
2014-06-13 16:01:39 -07:00
func TestPebbleDriverNotification(t *testing.T) {
d := initTestPebbleDriver()
d.SendNotification("Hello")
d.SendNotification("World")
gobot.Assert(t, d.Messages[0], "Hello")
gobot.Assert(t, d.PendingMessage(), "Hello")
gobot.Assert(t, d.PendingMessage(), "World")
gobot.Assert(t, d.PendingMessage(), "")
2014-06-13 14:18:57 -07:00
}