public void GetAndUpdateList_IDOfFirstAndFourthSongsShouldBeTheSameInBothListAndInsertedArray() { Playlist.Playlist playlist = new Playlist.Playlist(); List<Song> songList = new List<Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(new ObservableCollection<Song>(songList)); Assert.AreEqual(1, playlist.GetList()[0].ID); Assert.AreEqual(4, playlist.GetList()[3].ID); }
public void GetAndUpdateList_IDOfFirstAndFourthSongsShouldBeTheSameInBothListAndInsertedArray() { Playlist.Playlist playlist = new Playlist.Playlist(); List <Song> songList = new List <Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(songList); Assert.AreEqual(1, playlist.GetList()[0].ID); Assert.AreEqual(4, playlist.GetList()[3].ID); }
public void RemoveSong_IDsOfThirdSongShouldBe4AndFirstSongShouldBe2() { Playlist.Playlist playlist = new Playlist.Playlist(); List<Song> songList = new List<Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(new ObservableCollection<Song>(songList)); playlist.RemoveFromList(2); Assert.AreEqual(4, playlist.GetList()[2].ID); playlist.RemoveFromList(0); Assert.AreEqual(2, playlist.GetList()[0].ID); }
public void RemoveSong_IDsOfThirdSongShouldBe4AndFirstSongShouldBe2() { Playlist.Playlist playlist = new Playlist.Playlist(); List <Song> songList = new List <Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(songList); playlist.RemoveFromList(2); Assert.AreEqual(4, playlist.GetList()[2].ID); playlist.RemoveFromList(0); Assert.AreEqual(2, playlist.GetList()[0].ID); }
public void SortByDownloaded_PropertyDownloadedOfFirstAndSecondSongsShouldBeTrue() { Playlist.Playlist playlist = new Playlist.Playlist(); List<Song> songList = new List<Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); songList[1].Downloaded = true; songList[3].Downloaded = true; playlist.UpdateList(songList); playlist.SortByDownloaded(); Assert.AreEqual(true, playlist.GetList()[0].Downloaded); Assert.AreEqual(true, playlist.GetList()[1].Downloaded); }
public void SortByDownloaded_PropertyDownloadedOfFirstAndSecondSongsShouldBeTrue() { Playlist.Playlist playlist = new Playlist.Playlist(); List <Song> songList = new List <Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); songList[1].Downloaded = true; songList[3].Downloaded = true; playlist.UpdateList(songList); playlist.SortByDownloaded(); Assert.AreEqual(true, playlist.GetList()[0].Downloaded); Assert.AreEqual(true, playlist.GetList()[1].Downloaded); }
public void AddToList_IDOfFirstThirdAndFiftsSongsShouldBe8() { Playlist.Playlist playlist = new Playlist.Playlist(); List<Song> songList = new List<Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(new ObservableCollection<Song>(songList)); Song insertedSong = new Song(8); playlist.AddToList(insertedSong, 0); Assert.AreEqual(insertedSong.ID, playlist.GetList()[0].ID); playlist.AddToList(insertedSong, 5); Assert.AreEqual(insertedSong.ID, playlist.GetList()[5].ID); playlist.AddToList(insertedSong, 3); Assert.AreEqual(insertedSong.ID, playlist.GetList()[3].ID); }
public void AddToList_IDOfFirstThirdAndFiftsSongsShouldBe8() { Playlist.Playlist playlist = new Playlist.Playlist(); List <Song> songList = new List <Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(songList); Song insertedSong = new Song(8); playlist.AddToList(insertedSong, 0); Assert.AreEqual(insertedSong.ID, playlist.GetList()[0].ID); playlist.AddToList(insertedSong, 5); Assert.AreEqual(insertedSong.ID, playlist.GetList()[5].ID); playlist.AddToList(insertedSong, 3); Assert.AreEqual(insertedSong.ID, playlist.GetList()[3].ID); }
public void MoveSong_IDOfThirdSongShouldBe1() { Playlist.Playlist playlist = new Playlist.Playlist(); List<Song> songList = new List<Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(new ObservableCollection<Song>(songList)); playlist.MoveSong(0, 2); Assert.AreEqual(1, playlist.GetList()[2].ID); }
public void MoveSong_IDOfThirdSongShouldBe1() { Playlist.Playlist playlist = new Playlist.Playlist(); List <Song> songList = new List <Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(songList); playlist.MoveSong(0, 2); Assert.AreEqual(1, playlist.GetList()[2].ID); }
public void AddToList_IDOfFirstSongInArrayAndFifthSongInListShouldBeTheSame() { Playlist.Playlist playlist = new Playlist.Playlist(); List<Song> songList = new List<Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(new ObservableCollection<Song>(songList)); Song[] insertedArrayOfSongs = new Song[] { new Song(9), new Song(8), new Song(7) }; playlist.AddToList(insertedArrayOfSongs, 4); Assert.AreEqual(insertedArrayOfSongs[0].ID, playlist.GetList()[4].ID); }
public void AddToList_IDOfFirstSongInArrayAndFifthSongInListShouldBeTheSame() { Playlist.Playlist playlist = new Playlist.Playlist(); List <Song> songList = new List <Song>(); songList.AddRange(new Song[] { new Song(1), new Song(2), new Song(3), new Song(4) }); playlist.UpdateList(songList); Song[] insertedArrayOfSongs = new Song[] { new Song(9), new Song(8), new Song(7) }; playlist.AddToList(insertedArrayOfSongs, 4); Assert.AreEqual(insertedArrayOfSongs[0].ID, playlist.GetList()[4].ID); }
private void buttonDownload_Click(object sender, RoutedEventArgs e) { List <Song> ListToDownload = new List <Song>(); if (sender.GetHashCode() == buttonDownload.GetHashCode()) { ListToDownload.Add(Playlist1.GetList()[_CurrentSong]); } else { ListToDownload = Playlist1.GetList(); } if (Downloader1.DownloadSong(ListToDownload) == Common.Common.Status.Error) { MessageBox.Show("Ошибка скачивания", "", MessageBoxButton.OK); } }