Hello!
Is it worth to write unit-tests for such the simple code:
public class TableController {
private TableView view;
public TableController(TableView view) {
this.view = view;
}
public void onShowTable() {
view.showTable();
}
}
I have a lot of such very simple code in my projects which connects controllers, views, services, remote services, etc. Unit-tests just repeat everything and are usually larger than the code itself:
public class TableControllerTest {
@Test
public void showTable() {
TableView view = createMock(TableView.class);
view.showTable();
replayAll();
TableController controller = new TableController(view);
controller.onShowTable();
verifyAll();
}
}
Are such tests really needed?
Thanks!