Closed andrii-bodnar closed 10 months ago
I would like to work on this if no one else is!
@ernestorendon thank you!
Hi @ernestorendon, , any updates on this?
Hi @andrii-bodnar, I am willing to work on this. I've found low code coverage is due to few models in tasks/model
being left out in testing. How do you want me to proceed? I'm mentioning a change by which I think we can increase coverage.
In TasksApiTest file, I am trying to cover test for Assignee model class
@Test
public void listTasksTest() {
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
ResponseList<Task> taskResponseList = this.getTasksApi().listTasks(projectId, null, null, null);
assertEquals(taskResponseList.getData().size(), 1);
assertEquals(taskResponseList.getData().get(0).getData().getId(), taskId);
assertEquals(taskResponseList.getData().get(0).getData().getStatus(), status);
assertEquals(new Date(119, Calendar.SEPTEMBER,27,7,0,14), taskResponseList.getData().get(0).getData().getDeadline());
}
@Test
public void listTasksTest() {
Assignee assignee = new Assignee();
assignee.setId(1L);
assignee.setUsername("john_smith");
assignee.setFullName("john_smith");
assignee.setAvatarUrl("");
assignee.setWordsCount(5);
assignee.setWordsLeft(3);
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
ResponseList<Task> taskResponseList = this.getTasksApi().listTasks(projectId, null, null, null);
assertEquals(taskResponseList.getData().size(), 1);
assertEquals(taskResponseList.getData().get(0).getData().getId(), taskId);
assertEquals(taskResponseList.getData().get(0).getData().getStatus(), status);
assertEquals(new Date(119, Calendar.SEPTEMBER,27,7,0,14), taskResponseList.getData().get(0).getData().getDeadline());
assertEquals(taskResponseList.getData().get(0).getData().getAssignees().get(0), assignee);
}
Please guide me on this, whether I am wrong or any other way you suggest
Hi @akashpambhar, great, feel free to create a PR, thanks!
The
tasks
package has low code coverage by Unit tests. We need to add more Unit tests to cover the code.References: