예제 #1
0
  /** Tests for line2_2_10_7. */
  @Test
  public void testLine2_2_10_7() {
    final String expected = "2,5;3,5;4,5;5,5;6,6;7,6;8,6;9,6;10,7;";
    final StringBuilder sb = new StringBuilder();

    Line.renderLine(
        2,
        5,
        10,
        7,
        new Action() {

          @Override
          public void fire(final int x, final int y) {
            sb.append(x + "," + y + ";");
          }
        });
    assertEquals(
        "Current path finding. Note if you improve the "
            + "pathfinder, you need to adjust this test.",
        expected,
        sb.toString());
  }
예제 #2
0
  /** Tests for line1_1_10_10. */
  @Test
  public void testLine1_1_10_10() {

    final String expected = "1,1;2,2;3,3;4,4;5,5;6,6;7,7;8,8;9,9;10,10;";
    final StringBuilder sb = new StringBuilder();
    Line.renderLine(
        1,
        1,
        10,
        10,
        new Action() {

          @Override
          public void fire(final int x, final int y) {
            sb.append(x + "," + y + ";");
          }
        });

    assertEquals(
        "Current path finding. Note if you improve the "
            + "pathfinder, you need to adjust this test.",
        expected,
        sb.toString());
  }
예제 #3
0
  /** Tests for line. */
  @Test
  public void testLine() {
    final String expected =
        "10,10;11,10;12,10;13,11;14,11;15,12;16,12;17,13;18,13;19,14;20,14;21,14;22,15;23,15;24,16;25,16;26,17;27,17;28,18;29,18;30,18;31,19;32,19;33,20;34,20;35,21;36,21;37,22;38,22;39,22;40,23;41,23;42,24;43,24;44,25;45,25;46,26;47,26;48,26;49,27;50,27;51,28;52,28;53,29;54,29;55,30;56,30;57,30;58,31;59,31;60,32;61,32;62,33;63,33;64,34;65,34;66,34;67,35;68,35;69,36;70,36;71,37;72,37;73,38;74,38;75,38;76,39;77,39;78,40;79,40;80,41;81,41;82,42;83,42;84,42;85,43;86,43;87,44;88,44;89,45;90,45;91,46;92,46;93,46;94,47;95,47;96,48;97,48;98,49;99,49;100,50;";
    final StringBuilder sb = new StringBuilder();
    Line.renderLine(
        10,
        10,
        100,
        50,
        new Action() {

          @Override
          public void fire(final int x, final int y) {
            sb.append(x + "," + y + ";");
          }
        });

    assertEquals(
        "Current path finding. Note if you improve the "
            + "pathfinder, you need to adjust this test.",
        expected,
        sb.toString());
  }