public void testGotExtra() { ExpectedStrings myExp; String[] strings = {"stringOne", "stringTwo", "stringThree"}; myExp = new ExpectedStrings(strings); assertTrue("No found strings", !myExp.gotExtra()); myExp.foundString("stringOne"); assertTrue("1 found strings", !myExp.gotExtra()); myExp.foundString("stringTwo"); assertTrue("2 found strings", !myExp.gotExtra()); myExp.foundString("stringThree"); assertTrue("All found strings", !myExp.gotExtra()); myExp.foundString("Somerandomestring"); assertTrue("Extra String", myExp.gotExtra()); }
public void testGetMissingString() { ExpectedStrings myExp; String[] strings = {"stringOne", "stringTwo", "stringThree"}; myExp = new ExpectedStrings(strings); assertNotNull(myExp.getMissingString()); myExp.foundString("stringOne"); assertNotNull(myExp.getMissingString()); myExp.foundString("stringTwo"); assertNotNull(myExp.getMissingString()); myExp.foundString("stringThree"); assertNotNull(myExp.getMissingString()); }