示例#1
0
 @Test
 public void testChangeNote2() {
   s1.addNote(3, 1, 1, 5, 1, 100);
   s1.changeNote(3, 1, 1, 5, 1, 100, 2, 1, 1, 5, 1, 100);
   assertEquals(
       s1.notesPlayingAtRowAsString(1),
       "Note: D1, starting beat at: 1, "
           + "ending beat at: 5, played using instrument number: 1 STARTS playing");
   s1.changeNote(2, 1, 1, 5, 1, 100, 3, 1, 1, 5, 1, 100);
   assertEquals(
       s1.notesPlayingAtRowAsString(1),
       "Note: D#1, starting beat at: 1, "
           + "ending beat at: 5, played using instrument number: 1 STARTS playing");
 }
示例#2
0
 @Test
 public void testGetLowestOctave3() {
   s1.addNote(0, 2, 5, 50, 1, 100);
   s1.addNote(5, 7, 5, 5, 2, 100);
   assertEquals(s1.getLowestOctave(), 2);
   s1.changeNote(0, 2, 5, 50, 1, 100, 0, 0, 10, 12, 1, 100);
   assertEquals(s1.getLowestOctave(), 0);
 }
示例#3
0
  // Tests for changeNote
  @Test
  public void testChangeNote1() {
    s1.addNote(0, 1, 0, 5, 1, 100);
    Note n = new Note(0, 1, 0, 5, 1, 100);
    assertTrue(s1.notesStartPlayingAtRow(0).get(0).equals(n));
    s1.changeNote(0, 1, 0, 5, 1, 100, 1, 1, 10, 15, 1, 100);

    assertEquals(
        s1.notesPlayingAtRowAsString(10),
        "Note: C#1, starting beat at: 10, ending "
            + "beat at: 15, played using instrument number: 1 STARTS playing");
  }
示例#4
0
 // Tests changeNoteExceptions
 @Test(expected = IllegalArgumentException.class)
 public void testChangeIllegalNote() {
   s1.addNote(0, 1, 0, 5, 1, 100);
   s1.changeNote(3, 1, 1, 5, 1, 100, 2, 1, 1, 5, 1, 100);
 }