
import junit.framework.TestCase;

import java.util.Vector;

/**
 * Created by johnstarich on 6/26/16.
 */
public class Program1Test extends TestCase {
	public void testStable1() throws Exception {
		Program1 program = new Program1();
		Matching matching = Driver.parseMatchingProblem("small_inputs/4.in");

		Vector<Integer> newMatches = new Vector<>();
		newMatches.add(2);
		newMatches.add(0);
		newMatches.add(1);
		newMatches.add(3);
		matching = new Matching(matching, newMatches);

		System.out.println(matching);

		assertTrue(program.isStableMatching(matching));
	}

	public void testStable2() throws Exception {
		Program1 program = new Program1();
		Matching matching = Driver.parseMatchingProblem("small_inputs/4.in");

		Vector<Integer> newMatches = new Vector<>();
		newMatches.add(3);
		newMatches.add(2);
		newMatches.add(1);
		newMatches.add(0);
		matching = new Matching(matching, newMatches);

		System.out.println(matching);

		assertTrue(program.isStableMatching(matching));
	}

	public void testUnstable() throws Exception {
		Program1 program = new Program1();
		Matching matching = Driver.parseMatchingProblem("small_inputs/4.in");

		Vector<Integer> newMatches = new Vector<>();
		newMatches.add(0);
		newMatches.add(2);
		newMatches.add(3);
		newMatches.add(1);
		matching = new Matching(matching, newMatches);

		System.out.println(matching);

		assertFalse(program.isStableMatching(matching));
	}

	public void testStableBruteForce() throws Exception {
		Program1 program = new Program1();
		Matching matching = Driver.parseMatchingProblem("small_inputs/4.in");

		Matching result = program.stableMatchingBruteForce(matching);
		System.out.println(result);

		boolean stable = program.isStableMatching(result);
		System.out.println("Is stable: " + stable);

		assertTrue(stable);
	}
}
@@ -520,32 +520,52 @@
 ;%0A%0A%09%09assertTrue(
+%22Should be stable%22, 
 program.isStable
@@ -577,32 +577,32 @@
 ing(matching));%0A
-
 %09%7D%0A%0A%09public void
@@ -972,16 +972,36 @@
 ertTrue(
+%22Should be stable%22, 
 program.
@@ -1418,16 +1418,40 @@
 rtFalse(
+%22Should not be stable%22, 
 program.
@@ -1749,24 +1749,38 @@
 %0A%0A%09%09
-boolean
+assertTrue(%22Should be
  stable
- =
+%22,
  pro
@@ -1812,76 +1812,8 @@
 ult)
-;%0A%09%09System.out.println(%22Is stable: %22 + stable);%0A%0A%09%09assertTrue(stable
 );%0A%09

Add assertion messages