(t *testing.T, s Server)
| 43 | } |
| 44 | |
| 45 | func TestDeviceDelete(t *testing.T, s Server) { |
| 46 | key := ari.NewKey(ari.DeviceStateKey, "d1") |
| 47 | |
| 48 | runTest("ok", t, s, func(t *testing.T, m *mock, cl ari.Client) { |
| 49 | m.DeviceState.On("Delete", key).Return(nil) |
| 50 | |
| 51 | err := cl.DeviceState().Delete(key) |
| 52 | if err != nil { |
| 53 | t.Errorf("Error in remote device state Delete call: %s", err) |
| 54 | } |
| 55 | |
| 56 | m.DeviceState.AssertCalled(t, "Delete", key) |
| 57 | }) |
| 58 | |
| 59 | runTest("err", t, s, func(t *testing.T, m *mock, cl ari.Client) { |
| 60 | m.DeviceState.On("Delete", key).Return(errors.New("err")) |
| 61 | |
| 62 | err := cl.DeviceState().Delete(key) |
| 63 | if err == nil { |
| 64 | t.Errorf("Expected error in remote device state Delete call: %s", err) |
| 65 | } |
| 66 | |
| 67 | m.DeviceState.AssertCalled(t, "Delete", key) |
| 68 | }) |
| 69 | } |
| 70 | |
| 71 | func TestDeviceUpdate(t *testing.T, s Server) { |
| 72 | key := ari.NewKey(ari.DeviceStateKey, "d1") |
no test coverage detected