コード例 #1
0
ファイル: ActionTests.cs プロジェクト: outbred/Google.Music
        public async Task AdRemoveSongsFromPlaylist()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            Playlist item;

            Assert.IsNotNull(item = await mc.CreatePlaylist(Guid.NewGuid().ToString(), ""));

            RadioFeed tracks;

            Assert.IsNotNull(tracks = await
                                      mc.GetStationFeed(ExplicitType.Explicit,
                                                        new StationFeedStation
            {
                LibraryContentOnly = false,
                NumberOfEntries    = 25,
                RecentlyPlayed     = new Track[0],
                Seed = new StationSeed
                {
                    SeedType = 6
                }
            }
                                                        ));
            var track = tracks.Data.Stations.First().Tracks.First();

            Assert.IsNotNull(await mc.AddSongToPlaylist(item, track));

            var result = await mc.ListTracksFromPlaylist(item);

            Assert.IsTrue(result.Any(x => x.StoreId == track.StoreId));

            Assert.IsNotNull(await mc.RemoveSongsFromPlaylist(mc.GetTrackPlaylistEntry(item, track)));

            Assert.IsNotNull(await mc.DetelePlaylist(item));
        }