// Path: DotMatrixView/src/com/escapeindustries/dotmatrix/DigitDefinition.java
// public class DigitDefinition {
// 	private static int[] zero = { 1, 2, 3, 4, 5, 7, 13, 14, 20, 21, 27, 28, 34,
// 			35, 41,
// 
// 			49, 55, 56, 62, 63, 69, 70, 76, 77, 83, 85, 86, 87, 88, 89 };
// 
// 	private static int[] one = { 13, 20, 27, 34, 41, 55, 62, 69, 76, 83 };
// 	private static int[] two = { 1, 2, 3, 4, 5, 13, 20, 27, 34, 41, 43, 44, 45,
// 			46, 47, 49, 56, 63, 70, 77, 85, 86, 87, 88, 89 };
// 	private static int[] three = { 1, 2, 3, 4, 5, 13, 20, 27, 34, 41, 43, 44,
// 			45, 46, 47, 55, 62, 69, 76, 83, 85, 86, 87, 88, 89 };
// 	private static int[] four = { 7, 13, 14, 20, 21, 27, 28, 34, 35, 41, 43,
// 			44, 45, 46, 47, 55, 62, 69, 76, 83 };
// 	private static int[] five = { 1, 2, 3, 4, 5, 7, 14, 21, 28, 35, 43, 44, 45,
// 			46, 47, 55, 62, 69, 76, 83, 85, 86, 87, 88, 89 };
// 	private static int[] six = { 7, 14, 21, 28, 35, 43, 44, 45, 46, 47, 49, 55,
// 			56, 62, 63, 69, 70, 76, 77, 83, 85, 86, 87, 88, 89 };
// 	private static int[] seven = { 1, 2, 3, 4, 5, 13, 20, 27, 34, 41,
// 
// 	55, 62, 69, 76, 83 };
// 
// 	private static int[] eight = { 1, 2, 3, 4, 5, 7, 13, 14, 20, 21, 27, 28,
// 			34, 35, 41, 43, 44, 45, 46, 47, 49, 55, 56, 62, 63, 69, 70, 76, 77,
// 			83, 85, 86, 87, 88, 89 };
// 
// 	private static int[] nine = { 1, 2, 3, 4, 5, 7, 13, 14, 20, 21, 27, 28, 34,
// 			35, 41, 43, 44, 45, 46, 47, 55, 62, 69, 76, 83 };
// 	private static int[] allDotsOff = {};
// 
// 	public static int[][] patterns = { zero, one, two, three, four, five, six,
// 			seven, eight, nine, allDotsOff };
// }
// 
// Path: DotMatrixView/src/com/escapeindustries/dotmatrix/GlyphTransition.java
// public class GlyphTransition {
// 
// 	private DotChangeAction action;
// 
// 	/**
// 	 * Construct and configure a GlyphTransition.
// 	 * 
// 	 * @param action
// 	 *            action will be informed of all changes that need to be made
// 	 *            when transitions are calculated.
// 	 */
// 	public GlyphTransition(DotChangeAction action) {
// 		this.action = action;
// 	}
// 
// 	/**
// 	 * Inform the member DotChangeAction which dots need to be change state to
// 	 * move from the current state to the next state. The parameters are arrays
// 	 * of one dimensional coordinates beginning in the top right corner of the
// 	 * part of the {@link Grid} that the {@link Glyph} is being rendered in.
// 	 * 
// 	 * @param from
// 	 *            A list of 1 dimensional co-ordinates, in ascending order, of
// 	 *            dots that are currently on.
// 	 * @param to
// 	 *            A list of 1 dimensional co-ordinate, in ascending order, of
// 	 *            dots that will be on when the transition ends.
// 	 */
// 	public void makeTransition(int[] from, int[] to) {
// 		int f = 0;
// 		int t = 0;
// 		while (f < from.length && t < to.length) {
// 			if (from[f] == to[t]) {
// 				// Dot should stay on - no change
// 				f++;
// 				t++;
// 			} else if (from[f] > to[t]) {
// 				// Dot should be lit
// 				action.dotHasChanged(to[t], true);
// 				t++;
// 			} else {
// 				// Dot should be dimmed
// 				action.dotHasChanged(from[f], false);
// 				f++;
// 			}
// 		}
// 		if (f < from.length) {
// 			// Reached the end of to before the end of from - remaining from
// 			// must be dimmed
// 			for (; f < from.length; f++) {
// 				action.dotHasChanged(from[f], false);
// 			}
// 		} else if (t < to.length) {
// 			// Reached the end of from before the end of to - remaining to must
// 			// be lit
// 			for (; t < to.length; t++) {
// 				action.dotHasChanged(to[t], true);
// 			}
// 		}
// 	}
// }


import com.escapeindustries.dotmatrix.DigitDefinition;
import com.escapeindustries.dotmatrix.GlyphTransition;
import junit.framework.TestCase;
package com.escapeindustries.dotmatrix.tests;



public class DigitDisplayTests extends TestCase {

	// Shared between tests
	private int[] one;
	private int[] two;
	private int[] three;
	private DotChangeCounter counter;

	@Override
	protected void setUp() throws Exception {
// Path: DotMatrixView/src/com/escapeindustries/dotmatrix/DigitDefinition.java
// public class DigitDefinition {
// 	private static int[] zero = { 1, 2, 3, 4, 5, 7, 13, 14, 20, 21, 27, 28, 34,
// 			35, 41,
// 
// 			49, 55, 56, 62, 63, 69, 70, 76, 77, 83, 85, 86, 87, 88, 89 };
// 
// 	private static int[] one = { 13, 20, 27, 34, 41, 55, 62, 69, 76, 83 };
// 	private static int[] two = { 1, 2, 3, 4, 5, 13, 20, 27, 34, 41, 43, 44, 45,
// 			46, 47, 49, 56, 63, 70, 77, 85, 86, 87, 88, 89 };
// 	private static int[] three = { 1, 2, 3, 4, 5, 13, 20, 27, 34, 41, 43, 44,
// 			45, 46, 47, 55, 62, 69, 76, 83, 85, 86, 87, 88, 89 };
// 	private static int[] four = { 7, 13, 14, 20, 21, 27, 28, 34, 35, 41, 43,
// 			44, 45, 46, 47, 55, 62, 69, 76, 83 };
// 	private static int[] five = { 1, 2, 3, 4, 5, 7, 14, 21, 28, 35, 43, 44, 45,
// 			46, 47, 55, 62, 69, 76, 83, 85, 86, 87, 88, 89 };
// 	private static int[] six = { 7, 14, 21, 28, 35, 43, 44, 45, 46, 47, 49, 55,
// 			56, 62, 63, 69, 70, 76, 77, 83, 85, 86, 87, 88, 89 };
// 	private static int[] seven = { 1, 2, 3, 4, 5, 13, 20, 27, 34, 41,
// 
// 	55, 62, 69, 76, 83 };
// 
// 	private static int[] eight = { 1, 2, 3, 4, 5, 7, 13, 14, 20, 21, 27, 28,
// 			34, 35, 41, 43, 44, 45, 46, 47, 49, 55, 56, 62, 63, 69, 70, 76, 77,
// 			83, 85, 86, 87, 88, 89 };
// 
// 	private static int[] nine = { 1, 2, 3, 4, 5, 7, 13, 14, 20, 21, 27, 28, 34,
// 			35, 41, 43, 44, 45, 46, 47, 55, 62, 69, 76, 83 };
// 	private static int[] allDotsOff = {};
// 
// 	public static int[][] patterns = { zero, one, two, three, four, five, six,
// 			seven, eight, nine, allDotsOff };
// }
// 
// Path: DotMatrixView/src/com/escapeindustries/dotmatrix/GlyphTransition.java
// public class GlyphTransition {
// 
// 	private DotChangeAction action;
// 
// 	/**
// 	 * Construct and configure a GlyphTransition.
// 	 * 
// 	 * @param action
// 	 *            action will be informed of all changes that need to be made
// 	 *            when transitions are calculated.
// 	 */
// 	public GlyphTransition(DotChangeAction action) {
// 		this.action = action;
// 	}
// 
// 	/**
// 	 * Inform the member DotChangeAction which dots need to be change state to
// 	 * move from the current state to the next state. The parameters are arrays
// 	 * of one dimensional coordinates beginning in the top right corner of the
// 	 * part of the {@link Grid} that the {@link Glyph} is being rendered in.
// 	 * 
// 	 * @param from
// 	 *            A list of 1 dimensional co-ordinates, in ascending order, of
// 	 *            dots that are currently on.
// 	 * @param to
// 	 *            A list of 1 dimensional co-ordinate, in ascending order, of
// 	 *            dots that will be on when the transition ends.
// 	 */
// 	public void makeTransition(int[] from, int[] to) {
// 		int f = 0;
// 		int t = 0;
// 		while (f < from.length && t < to.length) {
// 			if (from[f] == to[t]) {
// 				// Dot should stay on - no change
// 				f++;
// 				t++;
// 			} else if (from[f] > to[t]) {
// 				// Dot should be lit
// 				action.dotHasChanged(to[t], true);
// 				t++;
// 			} else {
// 				// Dot should be dimmed
// 				action.dotHasChanged(from[f], false);
// 				f++;
// 			}
// 		}
// 		if (f < from.length) {
// 			// Reached the end of to before the end of from - remaining from
// 			// must be dimmed
// 			for (; f < from.length; f++) {
// 				action.dotHasChanged(from[f], false);
// 			}
// 		} else if (t < to.length) {
// 			// Reached the end of from before the end of to - remaining to must
// 			// be lit
// 			for (; t < to.length; t++) {
// 				action.dotHasChanged(to[t], true);
// 			}
// 		}
// 	}
// }


// Path: DotMatrixViewTests/src/com/escapeindustries/dotmatrix/tests/DigitDisplayTests.java
import com.escapeindustries.dotmatrix.DigitDefinition;
import com.escapeindustries.dotmatrix.GlyphTransition;
import junit.framework.TestCase;

package com.escapeindustries.dotmatrix.tests;



public class DigitDisplayTests extends TestCase {

	// Shared between tests
	private int[] one;
	private int[] two;
	private int[] three;
	private DotChangeCounter counter;

	@Override
	protected void setUp() throws Exception {
		one = DigitDefinition.patterns[1];