コード例 #1
0
ファイル: TablatureTest.java プロジェクト: sirajrauff/Tab2PDF
  /**
   * Test case for the method addMultiMeasureLine(StringTokenizer StrTkn) which accepts a
   * stringTokenizer and splits it into individual lines which are then added to the tablature's
   * measure. The StringTokenizer is delimited by spaces. This method is tested by passing it a
   * StringTokenizer and asserting that the tablature's measure contains the appropriately separated
   * lines.
   */
  @Test
  public void testAddMultiMeasureLine() {
    StringTokenizer sample =
        new StringTokenizer(
            "||*-----<5>-----------<7>----------------------------*|| "
                + "|-0--------------7--------------------------0---------| "
                + "||*-----<5>-----------<7>----------------------------*|| ");

    String one = "||*-----<5>-----------<7>----------------------------*||";
    String two = "|-0--------------7--------------------------0---------|";
    String three = "||*-----<5>-----------<7>----------------------------*||";

    test.addMultiMeasureLine(sample);

    assertEquals(test.getMeasures().get(0).getLines().get(0), one);
    assertEquals(test.getMeasures().get(1).getLines().get(0), two);
    assertEquals(test.getMeasures().get(2).getLines().get(0), three);
  }