1
0

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:
Mikołaj Pich
2017-09-18 18:15:33 +02:00
committed by Rafał Borcz
parent 690b730494
commit aae3d5d357
9 changed files with 38 additions and 35 deletions

View File

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

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

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

View File

@ -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;
}
}
}