-
Notifications
You must be signed in to change notification settings - Fork 4
/
Bai1TestRunner.java
28 lines (24 loc) · 759 Bytes
/
Bai1TestRunner.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
public class Bai1TestRunner {
@Test
public void test() {
Program p = new Program();
assertEquals(0, p.Puzzle(0));
assertEquals(2, p.Puzzle(1));
assertEquals(4, p.Puzzle(2));
}
public static void main(String[] args) {
Result result = JUnitCore.runClasses(Bai1TestRunner.class);
for (Failure failure : result.getFailures()) {
String myFailure = new String(failure.toString());
myFailure = myFailure.replace("<", " ");
myFailure = myFailure.replace(">", " ");
System.out.println(myFailure);
}
System.out.println(result.wasSuccessful());
}
}