public class TestCounter {
    public static void main (String[] args) {
        int count = 1; // for compiling

		// Test case 1
		try {
            Counter c0 = new Counter(0,1);
            Counter c1 = new Counter(0,2);

			System.out.print("Counter: Test case 1 ... ");

			if (!c0.equals(c1)) {
				System.out.println("passed.");
				count++;
			} else {
				System.out.println("failed.");
			}
		} catch(Exception e) {
			System.out.println("Counter: Test case 1 crashed.");
			System.out.println("Error:" + e);
		}

		// Test case 2
		try {
            Counter c0 = new Counter(0,1);
            Counter c2 = new Counter(1,1);

			System.out.print("Counter: Test case 2 ... ");

			if (!c0.equals(c2)) {
				System.out.println("passed.");
				count++;
			} else {
				System.out.println("failed.");
			}
		} catch(Exception e) {
			System.out.println("Counter: Test case 2 crashed.");
			System.out.println("Error:" + e);
		}

		// Test case 3
		try {
            Counter c1 = new Counter(0,2);
            Counter c2 = new Counter(1,1);

			System.out.print("Counter: Test case 3 ... ");

			if (!c1.equals(c2)) {
				System.out.println("passed.");
				count++;
			} else {
				System.out.println("failed.");
			}
		} catch(Exception e) {
			System.out.println("Counter: Test case 4 crashed.");
			System.out.println("Error:" + e);
		}

		// Test case 4
		try {
            Counter c2 = new Counter(1,1);
            Counter c3 = new Counter(1,1);

			System.out.print("Counter: Test case 4 ... ");

			if (c2.equals(c3)) {
				System.out.println("passed.");
				count++;
			} else {
				System.out.println("failed.");
			}
		} catch(Exception e) {
			System.out.println("Counter: Test case 4 crashed.");
			System.out.println("Error:" + e);
		}

		// Test case 5
		try {
            Counter c0 = new Counter(0,1);
            Counter c4 = null;

			System.out.println(
				"Counter test case 5 is the only test (other than in TestWeatherSensor)"
			    + "\nwhere we check to see if your code handles a null argument.");

			System.out.print("Counter: Test case 5 ... ");
			if (!c0.equals(c4)) {
				System.out.println("passed.");
				count++;
			} else {
				System.out.println("failed.");
			}
		} catch(Exception e) {
			System.out.println("Counter: Test case 5 crashed.");
			System.out.println("Error:" + e);
		}


        System.exit(count);
    }
}
