hybridgroup.gobot/adaptor_test.go

19 lines
368 B
Go
Raw Normal View History

package gobot
import "testing"
func TestAdaptor(t *testing.T) {
a := NewAdaptor("", "testBot", "/dev/null")
Refute(t, a.Name(), "")
a.SetPort("/dev/null1")
Assert(t, a.Port(), "/dev/null1")
a.SetName("myAdaptor")
Assert(t, a.Name(), "myAdaptor")
2014-08-21 02:41:16 +08:00
a.SetConnected(true)
Assert(t, a.Connected(), true)
2014-08-21 02:41:16 +08:00
a.SetConnected(false)
2014-08-21 02:41:16 +08:00
Assert(t, a.Connected(), false)
}