-
Notifications
You must be signed in to change notification settings - Fork 0
/
JukeboxTest.java
65 lines (45 loc) · 1.38 KB
/
JukeboxTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package jukebox;
import java.util.LinkedList;
import junit.framework.TestCase;
public class JukeboxTest extends TestCase {
public void testPrintPlayList() {
Song s1 = new Song("love");
Song s2 = new Song("love again");
Song s3 = new Song("i love love");
Song s4 = new Song("a");
Song s5 = new Song("girl");
Song s6 = new Song("h");
Song s7 = new Song("k");
LinkedList<Song> songs = new LinkedList<Song>();
songs.add(s1);
songs.add(s2);
songs.add(s3);
songs.add(s4);
songs.add(s5);
songs.add(s6);
songs.add(s7);
Jukebox test = new Jukebox(songs);
test.printPlayList();
}
public void testNumberPopular() {
fail("Not yet implemented");
}
public void testNumberUnusual() {
fail("Not yet implemented");
}
public void testRemoveSoppySongs() {
Song s1 = new Song("love");
Song s2 = new Song("love again");
Song s3 = new Song("a");
LinkedList<Song> testing = new LinkedList<Song>();
testing.add(s3);
Jukebox expected = new Jukebox(testing);
LinkedList<Song> songs = new LinkedList<Song>();
songs.add(s1);
songs.add(s2);
songs.add(s3);
Jukebox actual = new Jukebox(songs);
actual.removeSoppySongs();
assertTrue(expected.getPlaylist().size() == actual.getPlaylist().size() && actual.playlistContains(expected.getPlaylist().getFirst()));
}
}