-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestTriangle.java
47 lines (39 loc) · 890 Bytes
/
TestTriangle.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package lab1.ts;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class)
public class TestTriangle {
Triangle tri = null;
private boolean expected;
private int input;
public TestTriangle(int input, boolean expected)
{
this.expected = expected;
this.input = input;
}
@Before
public void setUp() {
tri = new Triangle();
// tri.judge(0);
}
@Parameters
public static Collection<Object[]> getData(){
return Arrays.asList(new Object[][] {
{0, false},
{98, false},
{10, true},
{67, false},
{81, true}
});
}
@Test
public void testTriangle() {
assertEquals(this.expected, tri.judge(this.input));
}
}