WordSet { @Override public String toString() { return title; } WordSet(String line); @Override String toString(); public String name; public String title; public String[] words; }
@Test public void seasons() { WordSet wordSet = new WordSet("seasons\tSeasons\tSPRING,SUMMER,AUTUMN,WINTER"); assertEquals("seasons", wordSet.name); assertEquals("Seasons", wordSet.title); assertEquals(4, wordSet.words.length); assertEquals("SPRING", wordSet.words[0]); assertEquals("SUMMER", wordSet.words[1]); assertEquals("AUTUMN", wordSet.words[2]); assertEquals("WINTER", wordSet.words[3]); assertEquals("Seasons", wordSet.toString()); }