コード例 #1
0
        public bool FollowArtist(string artistId)
        {
            bool isFollowed = _artistsUtils.GetFollowedArtists().Any(artist => artist.Id == artistId);

            if (isFollowed)
            {
                throw new ArgumentException("Artist is already followed.");
            }
            _spotifyApi.Spotify.Follow(FollowType.Artist, new List <string>()
            {
                artistId
            });
            return(true);
        }
コード例 #2
0
        public void GenerateArtists_FullArtistsList_ReturnsMenuWithIncrementedTracksAmount()
        {
            var followedArtists = _artistsUtils.GetFollowedArtists();
            var menu            = _artistsGenerator.GenerateArtists(followedArtists);

            Assert.AreEqual(followedArtists.Count + 1, menu.items.Count);
        }
コード例 #3
0
        public bool FollowedArtists()
        {
            var  followedArtists = _artistsUtils.GetFollowedArtists();
            var  artistsMenu     = _artistsGenerator.GenerateArtists(followedArtists);
            bool running         = true;

            while (running)
            {
                running = artistsMenu.Display();
            }

            return(true);
        }
コード例 #4
0
        public void GetFollowedArtists_ReturnsList()
        {
            var followedArtists = _artistsUtils.GetFollowedArtists();

            Assert.AreNotEqual(0, followedArtists.Count);
        }