Menu

#14 Fail for method returning class itself

open
nobody
None
5
2002-02-15
2002-02-15
Anonymous
No

Having a method who's return type is that of the class
it belongs to seems to cause the NoUnit report to
indicate that all methods in that class are not tested.

Example,

public class MyClass
{
public MyClass()
{
}

public MyClass someMethod()
{
return new MyClass();
}
}

By having the "someMethod" method, it will cause all
other methods in the class to seem like they were
never tested even if there are Junit tests for them.
Simply commenting the method, restores proper
functionality.

This is a problem if you actually want to return
something of the class type.

Discussion


Log in to post a comment.