Skip to content

Commit 30cb7bc

Browse files
committed
integrate codecov.io added tests
1 parent c227d6b commit 30cb7bc

2 files changed

Lines changed: 22 additions & 17 deletions

File tree

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ before_install:
66
- wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)
77

88
after_success:
9-
- java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r target/site/jacoco/jacoco.xml
9+
- java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r target/site/jacoco/jacoco.xml
10+
- bash <(curl -s https://codecov.io/bash)

src/test/java/com/github/shitlib/java/OhShitTest.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.junit.jupiter.api.Test;
44

5-
import static org.junit.jupiter.api.Assertions.*;
65
import static com.github.shitlib.java.OhShit.*;
76
import static org.assertj.core.api.Assertions.*;
87

@@ -19,32 +18,37 @@ public void ohShitClass() {
1918
}
2019

2120
@Test
22-
public void ohShitInteger1() {
23-
//TODO:
24-
assertTrue(true);
21+
public void ohShitInteger() {
22+
assertThat(ohShit(1)).isInstanceOf(Integer.class).isEqualTo(1);
2523
}
2624

2725
@Test
28-
public void ohShit2() {
29-
//TODO:
30-
assertTrue(true);
26+
public void ohShitByte() {
27+
assertThat(ohShit((byte) 1)).isInstanceOf(Byte.class).isEqualTo((byte) 1);
3128
}
3229

3330
@Test
34-
public void ohShit3() {
35-
//TODO:
36-
assertTrue(true);
31+
public void ohShitLong() {
32+
assertThat(ohShit(1L)).isInstanceOf(Long.class).isEqualTo(1L);
3733
}
3834

3935
@Test
40-
public void ohShit4() {
41-
//TODO:
42-
assertTrue(true);
36+
public void ohShitBoolean() {
37+
assertThat(ohShit(true)).isInstanceOf(Boolean.class).isEqualTo(true);
4338
}
4439

4540
@Test
46-
public void ohShit5() {
47-
//TODO:
48-
assertTrue(true);
41+
public void ohShitString() {
42+
assertThat(ohShit("a string")).isInstanceOf(String.class).isEqualTo("a string");
43+
}
44+
45+
@Test
46+
public void ohShitNull() {
47+
assertThat(ohShit(null)).isNull();
48+
}
49+
50+
@Test
51+
public void ohShitCharacter() {
52+
assertThat(ohShit('A')).isInstanceOf(Character.class).isEqualTo('A');
4953
}
5054
}

0 commit comments

Comments
 (0)