1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.chabala.brick.controllab;
20
21 import org.junit.Test;
22
23 import java.util.Arrays;
24 import java.util.stream.Collectors;
25
26 import static org.hamcrest.Matchers.*;
27 import static org.junit.Assert.assertThat;
28
29
30
31
32 public class InputIdTest {
33
34 @Test
35 public void testThereAreEightInputs() throws Exception {
36 assertThat(InputId.values(), arrayWithSize(8));
37 }
38
39 @Test
40 public void testThereAreFourPassiveInputs() throws Exception {
41 assertThat(Arrays.stream(InputId.values())
42 .map(InputId::getInputType)
43 .filter(InputType.PASSIVE::equals)
44 .collect(Collectors.toList()), hasSize(4));
45 }
46
47 @Test
48 public void testThereAreFourActiveInputs() throws Exception {
49 assertThat(Arrays.stream(InputId.values())
50 .map(InputId::getInputType)
51 .filter(InputType.ACTIVE::equals)
52 .collect(Collectors.toList()), hasSize(4));
53 }
54 }