this is the method which should be implemented:
public class RegisterApp { public static String execute(Name nm, Register regst) {
return "";
}
}
so far I got this but won't pass my tests:
these are the tests:
???????@Test
public void testExecute() {
Register r = new Register(10);
r.addName(new Name("Joe", "Bloggs"));
r.addName(new Name("Fred", "Jones"));
r.addName(new Name("Nila", "Singh"));
String result = RegisterApp.execute(new Name("Cassie", "Downturn"), r);
String expectedResult = "j.blo@email.com\nn.sin@email.com\nc.dow@email.com\n";
assertEquals("The string returned should match the expected result (run 1)", expectedResult, result);
/* Test with a second set of input data */
Register r2 = new Register(10);
r2.addName(new Name("Tim", "Russ"));
r2.addName(new Name("David", "Blunt"));
r2.addName(new Name("Remi", "Patel"));
String result2 = RegisterApp.execute(new Name("Cassie", "Downturn"), r2);
String expectedResult2 = "r.pat@email.com\nc.dow@email.com\n";
assertEquals("The string returned should match the expected result (run 2)", expectedResult2, result2);
}
}
??????????????