public void LogInFailAlreadyLoggedIn() { SpotifyPlayer player = CreateInitializedPlayer(); Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify); wrapper.Setup(s => s.LogIn()); player.LogIn(); wrapper.Verify(s => s.LogIn(), Times.Exactly(1)); wrapper.ResetCalls(); player.LogIn(); Assert.AreEqual(PlayerState.Stopped, player.State); }
private SpotifyPlayer CreateLoggedInPlayer() { SpotifyPlayer player = CreateInitializedPlayer(); Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify); wrapper.Setup(s => s.LogIn()); player.LogIn(); wrapper.ResetCalls(); return(player); }
public void LogOutSuccess() { SpotifyPlayer player = CreateInitializedPlayer(); Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify); wrapper.Setup(s => s.LogIn()); player.LogIn(); wrapper.Setup(p => p.LogOut()); player.LogOut(); wrapper.Verify(p => p.LogOut(), Times.Exactly(1)); Assert.AreEqual(PlayerState.Stopped, player.State); }
public void TryStartPlaylistFailed() { SpotifyPlayer player = CreateInitializedPlayer(); Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify); wrapper.Setup(s => s.LogIn()); player.LogIn(); wrapper.ResetCalls(); wrapper.Setup(s => s.TryStartPlaylist("test playlist", true)).Returns(false); player.TryStartPlaylist("test playlist", true); wrapper.Verify(s => s.TryStartPlaylist("test playlist", true), Times.Exactly(1)); Assert.AreEqual(PlayerState.Stopped, player.State); }