Indicate the changes required to LoginStoryTest (warning: this is a trick question):
public class LoginStoryTest { public void testLogin() { assertTrue( login("bob","bobspassword") ); assertTrue( login("BOB","bobspassword") ); assertFalse(login("bob","")); assertFalse(login("bob","BOBSPASSWORD") ); } }
A1:
No changes are required to LoginStoryTest or any other executable test.
Q2:
Indicate the changes required to the setInterface method of XTrackTest:
public void setTestInterface(String interfaceType){ if (interfaceType.equals("direct")) testInf = new TrackDirectInterface(); else if (interfaceType.equals("webart")) testInf = new TrackWebARTInterface(); else fail("Undefined interface " + interfaceType); }
A1:
You need to test for guitar and create the appropriate interface:
public void setTestInterface(String interfaceType){ if (interfaceType.equals("direct")) testInf = new TrackDirectInterface(); else if (interfaceType.equals("webart")) testInf = new TrackWebARTInterface(); else if (interfaceType.equals("guitar"))testInf = new TrackGUITARInterface(); else fail("Undefined interface " + interfaceType); }
Q3:
Are other changes required to XTrackTest or any other existing class?
A1:
No other changes are required to any existing class.