コード例 #1
0
 @Test
 public void addSongTest() {
   Library myLibrary = new Library();
   myLibrary.addSong(new Song("Song One", "Artist One"));
   myLibrary.addSong(new Song("Song Two", "Artist Two"));
   assertEquals(2, myLibrary.songCount());
 }
コード例 #2
0
 @Test
 public void removeSongTest() {
   Library removeSongLibrary = new Library();
   Song song1 = new Song("Song One", "Artist One");
   Song song2 = new Song("Song Two", "Artist Two");
   removeSongLibrary.addSong(song1);
   removeSongLibrary.addSong(song2);
   removeSongLibrary.removeSong(song1);
   assertEquals(1, removeSongLibrary.songCount());
 }
コード例 #3
0
 @Test
 public void emptyLibraryTest() {
   Library emptyLibrary = new Library();
   assertEquals(0, emptyLibrary.songCount());
 }