Skip to content

Commit a2a306f

Browse files
author
java-tester-x
committed
Hello JUnit!!!
Hello JUnit!!!
1 parent e0745e7 commit a2a306f

11 files changed

Lines changed: 91 additions & 0 deletions
File renamed without changes.

lib/hamcrest-core-1.3.jar

44 KB
Binary file not shown.
File renamed without changes.

lib/junit-4.11-javadoc.jar

370 KB
Binary file not shown.

lib/junit-4.11-sources.jar

148 KB
Binary file not shown.

lib/junit-4.11.jar

239 KB
Binary file not shown.

makeTest.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
javac -cp .;lib/junit-4.11.jar -d bin %1

runTest.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
java -cp .;bin/;lib/junit-4.11.jar;lib/hamcrest-core-1.3.jar org.junit.runner.JUnitCore %1

test/TestMyDate.java

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package test;
2+
3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertTrue;
5+
import static org.junit.Assert.assertFalse;
6+
7+
import org.junit.Test;
8+
import org.junit.Ignore;
9+
import org.junit.runner.RunWith;
10+
import org.junit.runners.JUnit4;
11+
12+
import src.MyDate;
13+
14+
/**
15+
* Tests for {@link src/MyDate.java}.
16+
*
17+
* @author java-tester-x
18+
*/
19+
public class TestMyDate {
20+
21+
private MyDate aDate;
22+
23+
public TestMyDate() {
24+
aDate = new MyDate(2013, 12, 31);
25+
}
26+
27+
@Test
28+
public void isLeapYearCase01() {
29+
assertTrue("failure - should be true", MyDate.isLeapYear(2012));
30+
}
31+
32+
@Test
33+
public void isLeapYearCase02() {
34+
assertTrue("failure - should be true", MyDate.isLeapYear(1600));
35+
}
36+
37+
@Test
38+
public void isLeapYearCase03() {
39+
assertFalse("failure - should be false", MyDate.isLeapYear(1900));
40+
}
41+
42+
@Test
43+
public void nextDay() {
44+
// assertEquals();
45+
}
46+
47+
@Test
48+
public void nextMonth() {
49+
//
50+
}
51+
52+
@Test
53+
public void nextYear() {
54+
//
55+
}
56+
57+
@Test
58+
public void previousDay() {
59+
//
60+
}
61+
62+
@Test
63+
public void previousMonth() {
64+
//
65+
}
66+
67+
@Test
68+
public void previousYear() {
69+
//
70+
}
71+
72+
@Test
73+
public void thisIsIgnored() {}
74+
}

0 commit comments

Comments
 (0)