/*============================================================================= | Author: Alexander "Apollon" Jerabek | | Course: CSc 227 | Instructor: L. McCann | | Description: This program instantiates an instance of the WordHelper class | and performs a series of methods calls to said object, which are accompanied | by print statements describing the expected behavior. This provides limited | testing of WordHelper's features. | | Deficiencies: The amount of testing of WordHelper's capabilities is | inadequate. This program is merely a sample of the types of tests that will | be run. Students are strongly encouraged to create their own main method or | greatly enhance this one. *===========================================================================*/ public class WordHelperClientCode { public static void main(String [] args) { /* instantiating new WordHelper object with the String "A-p-o-l-l-o-n"*/ //Testing constructor System.out.println("Creating new WordHelper with String " + "\"A-p-o-l-l-o-n\""); WordHelper x = new WordHelper("A-p-o-l-l-o-n"); /*testing syllable/pronouncation methods*/ //Testing getWord() System.out.println("getWord() should return: apollon" + "\ngot: " + x.getWord()); //Testing numberOfSyllables() System.out.println("numberOfSyllables() should return 3" + "\ngot: " + x.numberOfSyllables()); //Testing syllablize() System.out.println("syllablize() should return: a/pol/lon" + "\ngot: " + x.syllablize()); //Testing pronounce() System.out.println("pronounce() should return: ay-pol-lon" + "\ngot: " + x.pronounce()); /* setting state variable to "instantiable" */ //Testing setWord() System.out.println("Setting word to instantiable"); x.setWord("instantiable"); System.out.println("getWord() should return: instantiable" + "\ngot: " + x.getWord()); /*testing syllable/pronouncation methods*/ //Testing numberOfSyllables() System.out.println("numberOfSyllables() should return 3" + "\ngot: " + x.numberOfSyllables()); //Testing syllablize() System.out.println("syllablize() should return: instan/tiab/le" + "\ngot: " + x.syllablize()); //Testing pronounce() System.out.println("pronounce() should return: instan-tiab-le" + "\ngot: " + x.pronounce()); /* setting state variable to "caves" */ //Testing setWord() System.out.println("Setting word to caves"); x.setWord("caves"); System.out.println("getWord() should return: caves" + "\ngot: " + x.getWord()); /*testing syllable/pronouncation methods*/ //Testing numberOfSyllables() System.out.println("numberOfSyllables() should return 2" + "\ngot: " + x.numberOfSyllables()); //Testing syllablize() System.out.println("syllablize() should return: ca/ves" + "\ngot: " + x.syllablize()); //Testing pronounce() System.out.println("pronounce() should return: kay-vez" + "\ngot: " + x.pronounce()); }//end main }//end WordHelperClientCode