mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-29 13:49:14 +08:00
sphero: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
f261a166f9
commit
2d00fe94f1
@ -54,6 +54,13 @@ func initTestSpheroAdaptor() (*Adaptor, *nullReadWriteCloser) {
|
|||||||
return a, rwc
|
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) {
|
func TestSpheroAdaptor(t *testing.T) {
|
||||||
a, _ := initTestSpheroAdaptor()
|
a, _ := initTestSpheroAdaptor()
|
||||||
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Sphero"), true)
|
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Sphero"), true)
|
||||||
|
@ -18,6 +18,13 @@ func initTestSpheroDriver() *SpheroDriver {
|
|||||||
return NewSpheroDriver(a)
|
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) {
|
func TestSpheroDriver(t *testing.T) {
|
||||||
d := initTestSpheroDriver()
|
d := initTestSpheroDriver()
|
||||||
var ret interface{}
|
var ret interface{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user