summaryrefslogtreecommitdiff
path: root/src/tetris/tests/piece/TPieceTest.java
blob: 4bb9b53e83ab2cc84890b277066fc98beb036c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Jesse Morgan <jesterpm@u.washington.edu>
 * 
 * TCSS 305 - Autumn 2009
 * Tetris Project
 * 17 November 2009
 */

package tetris.tests.piece;

import tetris.piece.TPiece;
import tetris.piece.TetrisPiece;

/**
 * JUnit Test for the T Piece.
 * 
 * @author Jesse Morgan <jesterpm@u.washington.edu>
 * @version 1.0 17 November 2009
 */
public class TPieceTest extends TetrisPieceTest {
  /**
   * Array of the string representations of various rotations.
   */
  private static final String[] ROTATION_STRINGS =
      new String[] {"....\n.X..\nXXX.\n....", ".X..\nXX..\n.X..\n....",
        "....\nXXX.\n.X..\n....", "X...\nXX..\nX...\n...."};

  @Override
  protected int[] getOriginalPoints() {
    return new int[] {1, 1, 0, 2, 1, 2, 2, 2}; // Copied from the class.
  }

  @Override
  protected TetrisPiece getPiece(final int the_x, final int the_y) {
    return new TPiece(the_x, the_y);
  }

  @Override
  protected String[] getRotationStrings() {
    return ROTATION_STRINGS.clone();
  }
 
}