diff --git a/drivers/gpio/relay_driver_test.go b/drivers/gpio/relay_driver_test.go index 64433636..60bb5a44 100644 --- a/drivers/gpio/relay_driver_test.go +++ b/drivers/gpio/relay_driver_test.go @@ -44,3 +44,15 @@ func TestRelayDriverToggle(t *testing.T) { d.Toggle() gobottest.Assert(t, d.State(), false) } + +func TestRelayDriverCommands(t *testing.T) { + d := initTestRelayDriver(newGpioTestAdaptor()) + gobottest.Assert(t, d.Command("Off")(nil), nil) + gobottest.Assert(t, d.State(), false) + + gobottest.Assert(t, d.Command("On")(nil), nil) + gobottest.Assert(t, d.State(), true) + + gobottest.Assert(t, d.Command("Toggle")(nil), nil) + gobottest.Assert(t, d.State(), false) +}