コード例 #1
0
 @Test
 public void testGetSurroundingOctaveNotesForLowOctaveDoesNotReturnAboveTheNoteLimit() {
   List<BasicNote> notes = Arrays.asList(BasicNote.cNatural(), BasicNote.gNatural());
   List<MainNoteComponent> result = generator.generateSurroundingMainNotesForTrebleClef(notes, 0);
   List<MainNoteComponent> expected =
       Arrays.asList(
           new MainNoteComponent(BasicNote.cNatural(), 0),
           new MainNoteComponent(BasicNote.cNatural(), 1),
           new MainNoteComponent(BasicNote.gNatural(), 0),
           new MainNoteComponent(BasicNote.gNatural(), 1));
   assertThat(result, equalTo(expected));
 }
コード例 #2
0
 @Test
 public void testGetSurroundingOctaveNotesReturnsSameNotesOctaveAboveAndBelow() {
   List<BasicNote> notes = Arrays.asList(BasicNote.cNatural(), BasicNote.gNatural());
   List<MainNoteComponent> result = generator.generateSurroundingMainNotesForTrebleClef(notes, 1);
   List<MainNoteComponent> expected =
       Arrays.asList(
           new MainNoteComponent(BasicNote.cNatural(), 0),
           new MainNoteComponent(BasicNote.cNatural(), 1),
           new MainNoteComponent(BasicNote.cNatural(), 2),
           new MainNoteComponent(BasicNote.gNatural(), 0),
           new MainNoteComponent(BasicNote.gNatural(), 1),
           new MainNoteComponent(BasicNote.gNatural(), 2));
   assertThat(result, equalTo(expected));
 }