Ejemplo n.º 1
0
        public async Task LikeDislikeTrack()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            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();
            RecordRealTimeResponse data;

            Assert.IsNotNull(data = await mc.SetTrackRating(Rating.FiveStars, track));
            Assert.IsTrue(data.EventResults.All(x => x.Code != ResponseCode.Invalid));
            Assert.IsNotNull(data = await mc.SetTrackRating(Rating.OneStar, track));
            Assert.IsTrue(data.EventResults.All(x => x.Code != ResponseCode.Invalid));
            Assert.IsNotNull(data = await mc.SetTrackRating(Rating.NoRating, track));
            Assert.IsTrue(data.EventResults.All(x => x.Code != ResponseCode.Invalid));
        }
Ejemplo n.º 2
0
        public async Task Login()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
        }
Ejemplo n.º 3
0
        public async Task GetStreamUrl()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            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.GetStreamUrlAsync(track));
        }
Ejemplo n.º 4
0
        public async Task GetTrack()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            Assert.IsNotNull(await mc.GetTrackAsync("Tkou6ps7lrj2wz3c2ejrgar337m")); // Essence, By: Skrux
        }
Ejemplo n.º 5
0
        public async Task GetAlbum()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            Assert.IsNotNull(await mc.GetAlbumAsync("Bdyocq5dfo3a72heswzl7nhni64")); // Lunch Money - EP, By: SoySauce
        }
Ejemplo n.º 6
0
        public async Task ExploreTabs()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            Assert.IsNotNull(await mc.ExploreTabsAsync());
        }
Ejemplo n.º 7
0
        public async Task ListStationCategories()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            Assert.IsNotNull(await mc.ListStationCategoriesAsync());
        }
Ejemplo n.º 8
0
        public async Task ListPromotedTracksAsync()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            Assert.IsNotNull(await mc.ListPromotedTracksAsync());
        }
Ejemplo n.º 9
0
        public async Task CreateDeletePlaylist()
        {
            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(), ""));
            Assert.IsNotNull(await mc.DetelePlaylist(item));
        }
Ejemplo n.º 10
0
        public async Task ListPlaylistItems()
        {
            var account = CommonTests.GetAccount();
            var mc      = new MobileClient();

            Assert.IsTrue(await mc.LoginAsync(account.Item1, account.Item2));
            ResultList <Playlist> playlist;

            Assert.IsNotNull(playlist = await mc.ListPlaylistsAsync());
            Assert.IsNotNull(await mc.ListTracksFromPlaylist(playlist.Data.Items.First()));
        }
Ejemplo n.º 11
0
        public async Task ChangePlaylistShareState()
        {
            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(), "", ShareState.Public));
            Assert.IsTrue(await mc.IsPlaylistSharedAsync(item));
            item.ShareState       = ShareState.Private;
            Assert.IsNotNull(item = await mc.UpdatePlaylistAsync(item));
            Debug.WriteLine(item);
            Assert.IsFalse(await mc.IsPlaylistSharedAsync(item));
            Assert.IsNotNull(await mc.DetelePlaylist(item));
        }
Ejemplo n.º 12
0
        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));
        }