public void testOne() { LinkedList<Assertion> asserts = new LinkedList(); asserts.add(Assertion.create("John lives around here.")); PuzzleSolver testS = new PuzzleSolver(asserts); LinkedList<String> names = testS.getNames(); LinkedList<String> occupations = testS.getOccupations(); LinkedList<String> colors = testS.getColors(); assertEquals("[John]", names.toString()); assertEquals("[#u]", occupations.toString()); assertEquals("[#u]", colors.toString()); }
public void testSpecial() { LinkedList<Assertion> asserts = new LinkedList(); asserts.add(Assertion.create("John lives around here.")); asserts.add(Assertion.create("Mary lives around here.")); asserts.add(Assertion.create("The plumber lives in the yellow house.")); PuzzleSolver testS = new PuzzleSolver(asserts); LinkedList<String> names = testS.getNames(); LinkedList<String> occupations = testS.getOccupations(); LinkedList<String> colors = testS.getColors(); assertEquals("[John, Mary]", names.toString()); assertEquals("[plumber, #u]", occupations.toString()); assertEquals("[yellow, #u]", colors.toString()); }