I'm trying to use Junit to verify that something output by a method matches a string using assertequals, but I can't get it to work. Because it says that the test case is undefined for (String, Void) My code for the method is below
public void speciesInformation() {
switch (species){
case"Penguin":System.out.println("Penguin Trivia fact");
break;
default: System.out.println("There is no current information for that species");
break;
}
}
and the junit code I'm attempting to use is(other tests omitted):
public class AnimalsTest extends junit.framework.TestCase{
public void testSpeciesInfo() {
assertEquals(" Penguin Trivia fact/n", penguin.speciesInformation());
}
}
All my other tests work because they're based on a return, but this one is supposed to be based on what's printed by the public void method and I can't tell how to do it or find information on how.