Use codecov for code coverage (#25)
* Use codecov for code coverage * Change codacy coverage badge with codecov * Unify repo badges * Update download link * Update unit tests
This commit is contained in:

committed by
Rafał Borcz

parent
690b730494
commit
aae3d5d357
@ -56,7 +56,11 @@ public class GradesList extends Vulcan {
|
||||
Pattern pattern = Pattern.compile("#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})");
|
||||
Matcher matcher = pattern.matcher(row.select("td:nth-child(2) span.ocenaCzastkowa")
|
||||
.attr("style"));
|
||||
String color = matcher.find() ? matcher.group(1) : "";
|
||||
|
||||
String color = "";
|
||||
while (matcher.find()) {
|
||||
color = matcher.group(1);
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy", Locale.ROOT);
|
||||
Date d = sdf.parse(row.select("td:nth-child(5)").text());
|
||||
|
@ -2,24 +2,12 @@ package io.github.wulkanowy.api.grades;
|
||||
|
||||
public class Subject {
|
||||
|
||||
private int id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String predictedRating;
|
||||
|
||||
private String finalRating;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Subject setId(int id) {
|
||||
this.id = id;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -200,9 +200,7 @@ public class Account {
|
||||
myDao.update(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* called by internal mechanisms, do not call yourself.
|
||||
*/
|
||||
/** called by internal mechanisms, do not call yourself. */
|
||||
@Generated(hash = 1812283172)
|
||||
public void __setDaoSession(DaoSession daoSession) {
|
||||
this.daoSession = daoSession;
|
||||
|
@ -180,9 +180,7 @@ public class Subject {
|
||||
myDao.update(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* called by internal mechanisms, do not call yourself.
|
||||
*/
|
||||
/** called by internal mechanisms, do not call yourself. */
|
||||
@Generated(hash = 937984622)
|
||||
public void __setDaoSession(DaoSession daoSession) {
|
||||
this.daoSession = daoSession;
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
import io.github.wulkanowy.dao.entities.Grade;
|
||||
|
||||
|
||||
public class EntitiesCompareTest {
|
||||
public class EntitiesCompareTest extends EntitiesCompare {
|
||||
|
||||
private List<Grade> newList = new ArrayList<>();
|
||||
|
||||
|
@ -18,6 +18,7 @@ public class GradeTest {
|
||||
Assert.assertEquals(R.color.one_grade, new Grade().setValue("1+").getValueColor());
|
||||
Assert.assertEquals(R.color.one_grade, new Grade().setValue("+1").getValueColor());
|
||||
Assert.assertEquals(R.color.default_grade, new Grade().setValue("Np").getValueColor());
|
||||
Assert.assertEquals(R.color.default_grade, new Grade().setValue("7").getValueColor());
|
||||
Assert.assertEquals(R.color.default_grade, new Grade().setValue("").getValueColor());
|
||||
}
|
||||
|
||||
@ -31,5 +32,22 @@ public class GradeTest {
|
||||
|
||||
Assert.assertEquals(new Grade().setSubject("Religia").setValue("5").hashCode(),
|
||||
new Grade().setSubject("Religia").setValue("5").hashCode());
|
||||
|
||||
Assert.assertFalse(new Grade().setSubject("Informatyka")
|
||||
.equals(new FakeGrade().setSubject("Informatyka")));
|
||||
|
||||
Assert.assertFalse(new Grade().setSubject("Informatyka")
|
||||
.equals(null));
|
||||
}
|
||||
|
||||
private class FakeGrade {
|
||||
|
||||
private String subject;
|
||||
|
||||
private FakeGrade setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
this.subject = this.subject + subject;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user