| 281 | } |
| 282 | |
| 283 | func TestPauseDeviceNotFound(t *testing.T) { |
| 284 | const n = "test_device_name" |
| 285 | viper.Set("spotify.device_name", n) |
| 286 | |
| 287 | m := new(mocks.Client) |
| 288 | |
| 289 | ds := []spotify.PlayerDevice{ |
| 290 | { |
| 291 | ID: "ANOTHER_TEST_ID", |
| 292 | Active: true, |
| 293 | Restricted: false, |
| 294 | Name: "another_device_name", |
| 295 | Type: "", |
| 296 | Volume: 0, |
| 297 | }, |
| 298 | } |
| 299 | |
| 300 | m.On("PlayerDevices").Return(ds, nil) |
| 301 | |
| 302 | err := Pause(m) |
| 303 | assert.EqualError(t, err, fmt.Sprintf("client identified by %s not found", n)) |
| 304 | } |
| 305 | |
| 306 | func TestPausePlayerDevicesError(t *testing.T) { |
| 307 | viper.Set("spotify.device_name", "test_device_name") |