910111213141516171819
public class CountryTest { @Test public void testString() { Country command = new Country("USA"); CommandOutputBuilder output = new CommandOutputBuilder(); output.printLn("! UTILITIES"); output.printLn("COUNTRY USA"); output.printLn("PRINT");
2122232425262728293031
assertCommand(output, command); } @Test public void testEnum() { Country command = new Country(CountryCode.usa); CommandOutputBuilder output = new CommandOutputBuilder(); output.printLn("! UTILITIES"); output.printLn("COUNTRY USA"); output.printLn("PRINT");
3334353637383940414243
assertCommand(output, command); } @Test public void testDefault() { Country command = new Country(); CommandOutputBuilder output = new CommandOutputBuilder(); output.printLn("! UTILITIES"); output.printLn("COUNTRY USA"); output.printLn("PRINT");
4546474849505152535455
assertCommand(output, command); } @Test public void testFake() { Country command = new Country(); command.setCountryCode(CountryCode.big5); command.setCountryCode(""); command.getCountryCode(); command.toString(); }