public void LogOutFailNotLoggedIn() { SpotifyPlayer player = CreateInitializedPlayer(); Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify); player.LogOut(); Assert.AreEqual(PlayerState.Stopped, player.State); }
public void LogOutSucceedAlreadyPlaying() { SpotifyPlayer player = CreatePlayingSpotifyPlayer(); Mock <ISpotifyWrapper> wrapper = Mock.Get(player.Spotify); wrapper.Setup(p => p.LogOut()); wrapper.Setup(p => p.StopMusic()); player.LogOut(); wrapper.Verify(p => p.StopMusic(), Times.Exactly(1)); wrapper.Verify(p => p.LogOut(), Times.Exactly(1)); Assert.AreEqual(PlayerState.Stopped, player.State); }
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); }