1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-14 19:29:32 +08:00
hybridgroup.gobot/platforms/gpio/analog_sensor_driver_test.go
2014-06-13 16:01:39 -07:00

31 lines
660 B
Go

package gpio
import (
"github.com/hybridgroup/gobot"
"testing"
)
func initTestAnalogSensorDriver() *AnalogSensorDriver {
return NewAnalogSensorDriver(TestAdaptor{}, "bot", "1")
}
func TestAnalogSensorDriverStart(t *testing.T) {
d := initTestAnalogSensorDriver()
gobot.Expect(t, d.Start(), true)
}
func TestAnalogSensorDriverHalt(t *testing.T) {
d := initTestAnalogSensorDriver()
gobot.Expect(t, d.Halt(), true)
}
func TestAnalogSensorDriverInit(t *testing.T) {
d := initTestAnalogSensorDriver()
gobot.Expect(t, d.Init(), true)
}
func TestAnalogSensorDriverRead(t *testing.T) {
d := initTestAnalogSensorDriver()
gobot.Expect(t, d.Read(), 99)
}