1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00

sphero: increase test coverage

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-04-06 11:16:48 +02:00
parent f261a166f9
commit 2d00fe94f1
2 changed files with 14 additions and 0 deletions

View File

@ -54,6 +54,13 @@ func initTestSpheroAdaptor() (*Adaptor, *nullReadWriteCloser) {
return a, rwc
}
func TestSpheroAdaptorName(t *testing.T) {
a, _ := initTestSpheroAdaptor()
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Sphero"), true)
a.SetName("NewName")
gobottest.Assert(t, a.Name(), "NewName")
}
func TestSpheroAdaptor(t *testing.T) {
a, _ := initTestSpheroAdaptor()
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Sphero"), true)

View File

@ -18,6 +18,13 @@ func initTestSpheroDriver() *SpheroDriver {
return NewSpheroDriver(a)
}
func TestSpheroDriverName(t *testing.T) {
d := initTestSpheroDriver()
gobottest.Assert(t, strings.HasPrefix(d.Name(), "Sphero"), true)
d.SetName("NewName")
gobottest.Assert(t, d.Name(), "NewName")
}
func TestSpheroDriver(t *testing.T) {
d := initTestSpheroDriver()
var ret interface{}