コード例 #1
0
ファイル: SpotifyPlayerTests.cs プロジェクト: davidov541/SAMI
        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
ファイル: SpotifyPlayerTests.cs プロジェクト: davidov541/SAMI
        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);
        }