| 249 | } |
| 250 | |
| 251 | func TestPauseNoneActiveSuccess(t *testing.T) { |
| 252 | const n = "test_device_name" |
| 253 | viper.Set("spotify.device_name", n) |
| 254 | |
| 255 | m := new(mocks.Client) |
| 256 | |
| 257 | ds := []spotify.PlayerDevice{ |
| 258 | { |
| 259 | ID: "ANOTHER_TEST_ID", |
| 260 | Active: false, |
| 261 | Restricted: false, |
| 262 | Name: "another_device_name", |
| 263 | Type: "", |
| 264 | Volume: 0, |
| 265 | }, |
| 266 | { |
| 267 | ID: "TEST_ID", |
| 268 | Active: false, |
| 269 | Restricted: false, |
| 270 | Name: n, |
| 271 | Type: "", |
| 272 | Volume: 0, |
| 273 | }, |
| 274 | } |
| 275 | |
| 276 | m.On("PlayerDevices").Return(ds, nil) |
| 277 | m.On("Pause").Return(nil) |
| 278 | |
| 279 | err := Pause(m) |
| 280 | assert.NoError(t, err) |
| 281 | } |
| 282 | |
| 283 | func TestPauseDeviceNotFound(t *testing.T) { |
| 284 | const n = "test_device_name" |