예제 #1
0
  /**
   * Test case for the setSpacing(float mySpacing) which sets the spacing for each and every measure
   * currently in tablature. This method is tested by adding the measures m1 and m2 to tablature and
   * then setting tablature's spacing to 70f. The spacing of m1 and m2 in tablature is asserted to
   * equal 70f
   */
  @Test
  public void testSetSpacing() {
    assertEquals(test.getSpacing(), 5f, 0.0);

    m1.addLine("*--------------------------------2---------------------*");
    m1.addLine("||*-----<5>-----------<7>----------------------------*||");
    m1.addLine("||-0-----------7-----------------------------0---------|");
    m1.addLine("*--------------------------------2---------------------*");
    myMeasure.add(m1);

    m2.addLine("*--------------------------------2---------------------*");
    m2.addLine("||*-----<5>-----------<7>----------------------------*||");
    m2.addLine("||-0-----------7-----------------------------0---------|");
    myMeasure.add(m2);

    test.setMeasures(myMeasure);
    test.setSpacing(70f);

    assertEquals(test.getSpacing(), 70f, 0.0);
    assertEquals(test.getMeasures().get(0).getSpacing(), 70f, 0.0);
    assertEquals(test.getMeasures().get(1).getSpacing(), 70f, 0.0);
  }
예제 #2
0
 /**
  * Test case for the method getSpacing() which returns the current spacing value. The default
  * value for the spacing is 5f. This method is tested by asserting it returns 5f
  */
 @Test
 public void testGetSpacing() {
   assertEquals(test.getSpacing(), 5f, 0.0);
 }