summaryrefslogtreecommitdiff
path: root/src/tetris/tests/piece/LPieceTest.java
blob: 5adfb212a9696333a7e5b4708df7c28a5e783cef (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.LPiece;
import tetris.piece.TetrisPiece;

/**
 * JUnit Test for the L Piece.
 * 
 * @author Jesse Morgan <jesterpm@u.washington.edu>
 * @version 1.0 17 November 2009
 */
public class LPieceTest extends TetrisPieceTest {
  /**
   * Array of the string representations of various rotations.
   */
  private static final String[] ROTATION_STRINGS =
      new String[] {".X..\n.X..\n.XX.\n....", "..X.\nXXX.\n....\n....",
        "XX..\n.X..\n.X..\n....", "....\nXXX.\nX...\n...."};
  
  @Override
  protected int[] getOriginalPoints() {
    return new int[] {1, 0, 1, 1, 1, 2, 2, 2}; // Copied from the class.
  }

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

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