Example #1
0
 /** tests that getAllNotes works */
 @Test
 public void basicGetAllNotesTest() {
   List<MusicElement> elements = new ArrayList<MusicElement>();
   Note c = new Note(new Pitch('C'), new Fraction(1, 1), false);
   elements.add(c);
   Note b = new Note(new Pitch('B'), new Fraction(1, 1), false);
   elements.add(b);
   Chord chord = new Chord(elements);
   List<Note> notes = new ArrayList<Note>();
   notes.add(c);
   notes.add(b);
   assertEquals(chord.getAllNotes(), notes);
 }
Example #2
0
 /** tests that getAllNotes if no notes exist */
 @Test
 public void zeroGetAllNotesTest() {
   List<MusicElement> elements = new ArrayList<MusicElement>();
   Chord c = new Chord(elements);
   assertEquals(c.getAllNotes(), new ArrayList<Note>());
 }