| 217 | } |
| 218 | |
| 219 | func TestPauseSuccess(t *testing.T) { |
| 220 | const n = "test_device_name" |
| 221 | viper.Set("spotify.device_name", n) |
| 222 | |
| 223 | m := new(mocks.Client) |
| 224 | |
| 225 | ds := []spotify.PlayerDevice{ |
| 226 | { |
| 227 | ID: "ANOTHER_TEST_ID", |
| 228 | Active: true, |
| 229 | Restricted: false, |
| 230 | Name: "another_device_name", |
| 231 | Type: "", |
| 232 | Volume: 0, |
| 233 | }, |
| 234 | { |
| 235 | ID: "TEST_ID", |
| 236 | Active: false, |
| 237 | Restricted: false, |
| 238 | Name: n, |
| 239 | Type: "", |
| 240 | Volume: 0, |
| 241 | }, |
| 242 | } |
| 243 | |
| 244 | m.On("PlayerDevices").Return(ds, nil) |
| 245 | m.On("Pause").Return(nil) |
| 246 | |
| 247 | err := Pause(m) |
| 248 | assert.NoError(t, err) |
| 249 | } |
| 250 | |
| 251 | func TestPauseNoneActiveSuccess(t *testing.T) { |
| 252 | const n = "test_device_name" |