Yin
Junior Member
umm...let me meditate and get my answer...umm
Posts: 21
|
Post by Yin on Apr 2, 2002 22:34:29 GMT -5
for a method like this (given in modified TwoEndedLinkedList) public Object tail() { if (size() == 0) { throw new NoSuchElementException(); }
return tail.getItem(); }
do we still have to test it for empty case? and for the throwing excpetion case...we only need to test ONE method out of the whole class that throws an exception, correct? or do we need to force every method that throws an exception to throw an exception?
|
|
|
Post by Observer on Apr 2, 2002 23:10:52 GMT -5
Holy crap, I can see this taking me forever tommorow. I've left all doc comments and testing for the whole day tommorow.
|
|
barp
Full Member
Posts: 28
|
Post by barp on Apr 3, 2002 12:51:39 GMT -5
yah........I think we just test one that throws an exception. When we force an error, and throw an exception, are we suppose to do the try~catch thing.....so catch the exception then print a prompt saying ERROR.....or something, ~OR~ are we suppose to just do nothing at all? ??just throw it???AHHHHHHH
|
|
|
Post by gabbie on Apr 3, 2002 13:01:44 GMT -5
try the method catch the exception since exception is supposed to occur you catch it and do whatever you want.. as long as your method does that it means you have forced a exception and your method works
|
|
|
Post by EurasianVixen on Apr 3, 2002 22:38:26 GMT -5
Quick Q: do we need to test for private methods in the test classes? I don't remember ...
|
|
Yin
Junior Member
umm...let me meditate and get my answer...umm
Posts: 21
|
Post by Yin on Apr 3, 2002 23:35:15 GMT -5
nope..dun need to test private methods..
|
|