crowdin / crowdin-api-client-java

Java client library for Crowdin API
https://jitpack.io/#crowdin/crowdin-api-client-java
MIT License
65 stars 44 forks source link

Add more Unit tests for the `tasks` package #194

Closed andrii-bodnar closed 10 months ago

andrii-bodnar commented 11 months ago

The tasks package has low code coverage by Unit tests. We need to add more Unit tests to cover the code.

References:

ernestorendon commented 11 months ago

I would like to work on this if no one else is!

andrii-bodnar commented 11 months ago

@ernestorendon thank you!

andrii-bodnar commented 11 months ago

Hi @ernestorendon, , any updates on this?

akashpambhar commented 10 months ago

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());
}

Please guide me on this, whether I am wrong or any other way you suggest

andrii-bodnar commented 10 months ago

Hi @akashpambhar, great, feel free to create a PR, thanks!