Is there any point in Unit-Testing a method that the only thing it does is delegate work on another object? Example:
class abc {
...
public void MoveLeft()
{
fallingPiece.MoveLeft();
}
...
}
I am doing Unit-Tests for some existing classes I have, for learning purposes. It seems kinda odd to do a Unit-Test for this MoveLeft() method, for example. But I am unsure how would it have been had I done Test-First.
Thanks
Will your code break if I do this ? If it would, then you need a test to catch it.
Assumptions: abc is a public / exposed type and fallingPiece is a dependency. If this holds, then you need a test to test the MoveLeft behavior. If it isn’t a public type, then you need a test for the public type XYZ that uses abc as a colloborator/dependency. You don’t directly test it but it still needs to be tested.