Testing Delegate Methods

Posted on Fri 15 April 2016 in General Software Development, Testing • Tagged with delegate method, J. B. Rainsberger, JUnit, unit testing

We had an interesting discussion the other day: should we write unit tests for delegate methods, that is, methods that only delegate the call to a delegate object? Here's an example of such a method:

public void do(Object o1, Object o2) {
    delegate.do(o1,o2);
}

I said I did …


Continue reading