aio: additional test coverage for Analog Sensor

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-03-23 13:18:22 +01:00
parent 518a563597
commit 678476b612
1 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package aio
import (
"errors"
"strings"
"testing"
"time"
@ -107,3 +108,14 @@ func TestAnalogSensorDriverHalt(t *testing.T) {
t.Errorf("AnalogSensor was not halted")
}
}
func TestAnalogSensorDriverDefaultName(t *testing.T) {
d := NewAnalogSensorDriver(newAioTestAdaptor(), "1")
gobottest.Assert(t, strings.HasPrefix(d.Name(), "AnalogSensor"), true)
}
func TestAnalogSensorDriverSetName(t *testing.T) {
d := NewAnalogSensorDriver(newAioTestAdaptor(), "1")
d.SetName("mybot")
gobottest.Assert(t, d.Name(), "mybot")
}