Пример #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 setMeasures(ArrayList<Measure> myMeasure) which sets an arrayList of
   * measures as the tablature's measure. This method is tested by adding measures m1 and m2 to the
   * arrayList myMeasure and myMeasure is then used as an argument for this method. The tablature's
   * measures are then asserted to be the same as myMeasures
   */
  @Test
  public void testSetMeasures() {
    m1.addLine("*--------------------------------2---------------------*");
    m1.addLine("||*-----<5>-----------<7>----------------------------*||");
    m1.addLine("||-0-----------7-----------------------------0---------|");
    m1.addLine("*--------------------------------2---------------------*");
    m1.addLine("|-0--------------7--------------------------0---------||");
    m1.addLine("|-----0----------10-------------0-------0-------5s7----|");

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

    myMeasure.add(m1);
    myMeasure.add(m2);
    test.setMeasures(myMeasure);

    assertSame(test.getMeasures(), myMeasure);
  }