示例#1
0
        public void DisposeInitialized()
        {
            SpotifyPlayer          player  = CreateInitializedPlayer();
            Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify);

            wrapper.Setup(w => w.Dispose());

            player.Dispose();

            wrapper.Verify(w => w.Dispose(), Times.Exactly(1));
            Assert.IsNull(player.Spotify);
            Assert.AreEqual(PlayerState.Stopped, player.State);
        }
示例#2
0
        public void DisposePlaying()
        {
            SpotifyPlayer          player  = CreatePlayingSpotifyPlayer();
            Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify);

            wrapper.Setup(w => w.Dispose());
            wrapper.Setup(w => w.LogOut());
            wrapper.Setup(w => w.StopMusic());

            player.Dispose();

            wrapper.Verify(w => w.StopMusic(), Times.Exactly(1));
            wrapper.Verify(w => w.LogOut(), Times.Exactly(1));
            wrapper.Verify(w => w.Dispose(), Times.Exactly(1));
            Assert.IsNull(player.Spotify);
            Assert.AreEqual(PlayerState.Stopped, player.State);
        }