-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_3.java
More file actions
28 lines (24 loc) · 744 Bytes
/
task_3.java
File metadata and controls
28 lines (24 loc) · 744 Bytes
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
@RunWith(Parameterized.class)
public class CheckIsAdultTest {
private final int age;
private final boolean result;
public CheckIsAdultTest(int age, boolean result) {
this.age = age;
this.result = result;
}
@Parameterized.Parameters
public static Object[][] getTextData() {
return new Object[][] {
{18, true},
{21, true},
{17, false},
{20, true},
};
}
@Test
public void checkIsAdultWhenAgeThenResult() {
Program program = new Program();
boolean isAdult = program.checkIsAdult(age);
assertEquals("Пользователю не совершенолетный", result, isAdult);
}
}