本文整理汇总了C#中Playlist.MoveToNextSong方法的典型用法代码示例。如果您正苦于以下问题:C# Playlist.MoveToNextSong方法的具体用法?C# Playlist.MoveToNextSong怎么用?C# Playlist.MoveToNextSong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist.MoveToNextSong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlaylistsCanGoBack
public void PlaylistsCanGoBack()
{
string filename1 = "song1";
string filename2 = "song1";
var music1 = new MusicInfo() { FullPath = filename1 };
var music2 = new MusicInfo() { FullPath = filename2 };
var dummyPlaylistWatcher = new DummyPlaylistWatcher();
var playlist = new Playlist(dummyPlaylistWatcher);
playlist.Enqueue(music1);
playlist.Enqueue(music2);
Assert.AreEqual(2, playlist.Count, "There must be two songs in the playlist.");
MusicInfo song = playlist.CurrentSong;
Assert.AreEqual(filename1, song.FullPath, "The first item in the playlist must be correct.");
playlist.MoveToNextSong();
MusicInfo nextSong = playlist.CurrentSong;
Assert.AreEqual(filename2, nextSong.FullPath, "The second item in the playlist must be correct.");
playlist.MoveBackOneSong();
Assert.AreEqual(filename1, playlist.CurrentSong.FullPath, "Going back one song should go back to the first one.");
}