Example #1
0
        public void GetCurrentArtistNameFailNotPlaying()
        {
            SpotifyPlayer          player  = CreateLoggedInPlayer();
            Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify);

            String artistName = player.GetCurrentArtistName();

            Assert.IsNull(artistName);
            Assert.AreEqual(PlayerState.Stopped, player.State);
        }
Example #2
0
        public void GetCurrentArtistNameSucceed()
        {
            SpotifyPlayer          player  = CreatePlayingSpotifyPlayer();
            Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify);
            String expectedArtistName      = "Test Artist";

            wrapper.Setup(p => p.GetCurrentArtistName()).Returns(expectedArtistName);

            String artistName = player.GetCurrentArtistName();

            wrapper.Verify(p => p.GetCurrentArtistName(), Times.Exactly(1));
            Assert.AreEqual(expectedArtistName, artistName);
            Assert.AreEqual(PlayerState.Playing, player.State);
            StopPlayer(player);
        }