I have a simple array class with some methods such as Add(int n)
, AddAt(int n, int index)
, etc.
the addAt method calls another method from super class
public void addAt(int n, int index) {
if (checkIndex(index, size + 1)){
...
}
}
that checks if the inserted index is not out-bounded, if so the super class method prints an error message to console.
how should I test that if the message is printed? I am using JUnit4.12-beta