2014-04-27 19:34:16 -07:00
|
|
|
package gpio
|
2014-04-26 03:11:51 -07:00
|
|
|
|
|
|
|
import (
|
2014-06-12 20:08:06 -07:00
|
|
|
"github.com/hybridgroup/gobot"
|
|
|
|
"testing"
|
2014-04-26 03:11:51 -07:00
|
|
|
)
|
|
|
|
|
2014-06-13 16:01:39 -07:00
|
|
|
func initTestAnalogSensorDriver() *AnalogSensorDriver {
|
|
|
|
return NewAnalogSensorDriver(TestAdaptor{}, "bot", "1")
|
2014-06-12 20:08:06 -07:00
|
|
|
}
|
2014-04-26 03:11:51 -07:00
|
|
|
|
2014-06-13 16:01:39 -07:00
|
|
|
func TestAnalogSensorDriverStart(t *testing.T) {
|
|
|
|
d := initTestAnalogSensorDriver()
|
|
|
|
gobot.Expect(t, d.Start(), true)
|
2014-06-12 20:08:06 -07:00
|
|
|
}
|
2014-06-13 12:39:02 -07:00
|
|
|
|
2014-06-13 16:01:39 -07:00
|
|
|
func TestAnalogSensorDriverHalt(t *testing.T) {
|
|
|
|
d := initTestAnalogSensorDriver()
|
|
|
|
gobot.Expect(t, d.Halt(), true)
|
2014-06-12 20:08:06 -07:00
|
|
|
}
|
2014-06-13 12:39:02 -07:00
|
|
|
|
2014-06-13 16:01:39 -07:00
|
|
|
func TestAnalogSensorDriverInit(t *testing.T) {
|
|
|
|
d := initTestAnalogSensorDriver()
|
|
|
|
gobot.Expect(t, d.Init(), true)
|
2014-06-12 20:08:06 -07:00
|
|
|
}
|
2014-06-13 12:39:02 -07:00
|
|
|
|
2014-06-13 16:01:39 -07:00
|
|
|
func TestAnalogSensorDriverRead(t *testing.T) {
|
|
|
|
d := initTestAnalogSensorDriver()
|
|
|
|
gobot.Expect(t, d.Read(), 99)
|
2014-06-12 20:08:06 -07:00
|
|
|
}
|