Пример #1
0
        public void GetCurrentSongNameFailNotPlaying()
        {
            SpotifyPlayer          player  = CreateLoggedInPlayer();
            Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify);

            String songName = player.GetCurrentSongName();

            Assert.IsNull(songName);
            Assert.AreEqual(PlayerState.Stopped, player.State);
        }
Пример #2
0
        public void GetCurrentSongNameSucceed()
        {
            SpotifyPlayer          player  = CreatePlayingSpotifyPlayer();
            Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify);
            String expectedSongName        = "Test Song";

            wrapper.Setup(p => p.GetCurrentSongName()).Returns(expectedSongName);

            String songName = player.GetCurrentSongName();

            wrapper.Verify(p => p.GetCurrentSongName(), Times.Exactly(1));
            Assert.AreEqual(expectedSongName, songName);
            Assert.AreEqual(PlayerState.Playing, player.State);
            StopPlayer(player);
        }