| 92 | } |
| 93 | |
| 94 | func TestPlayUriDeviceNotFoundError(t *testing.T) { |
| 95 | const n = "test_device_name" |
| 96 | viper.Set("spotify.device_name", n) |
| 97 | |
| 98 | m := new(mocks.Client) |
| 99 | |
| 100 | d := spotify.PlayerDevice{ |
| 101 | ID: "TEST_ID", |
| 102 | Active: false, |
| 103 | Restricted: false, |
| 104 | Name: "another_device_name", |
| 105 | Type: "", |
| 106 | Volume: 0, |
| 107 | } |
| 108 | |
| 109 | ds := []spotify.PlayerDevice{d} |
| 110 | |
| 111 | m.On("PlayerDevices").Return(ds, nil) |
| 112 | |
| 113 | err := PlayUri(m, "foobar") |
| 114 | assert.EqualError(t, err, fmt.Sprintf("client identified by %s not found", n)) |
| 115 | } |
| 116 | |
| 117 | func TestPlayUriTransferPlaybackSuccess(t *testing.T) { |
| 118 | const n = "test_device_name" |