public void SavePlaylist(UltraStarPlaylist playlist) { string[] lines = playlist.GetLines(); string filePath = GetFilePathForPlaylist(playlist); File.WriteAllLines(filePath, lines); }
public void PlaylistTest() { UltraStarPlaylist playlist = new UltraStarPlaylist(); playlist.AddLineEntry(new UltraStartPlaylistLineEntry("# comment")); Assert.IsFalse(playlist.HasSongEntry("The artist", "The title")); Assert.AreEqual(1, playlist.GetLines().Length); playlist.AddLineEntry(new UltraStartPlaylistSongEntry("The artist", "The title")); Assert.IsTrue(playlist.HasSongEntry("The artist", "The title")); Assert.AreEqual(2, playlist.GetLines().Length); playlist.RemoveSongEntry("The artist", "The title"); Assert.IsFalse(playlist.HasSongEntry("The artist", "The title")); Assert.AreEqual(1, playlist.GetLines().Length); }