@@ -15,28 +15,32 @@ public class IsIterableContainingInAnyOrderTest extends AbstractMatcherTest {
15
15
protected Matcher <?> createMatcher () {
16
16
return containsInAnyOrder (1 , 2 );
17
17
}
18
-
19
- public void testDoesNotMatchEmpty () throws Exception {
18
+
19
+ public void testMatchesSingleItemIterable () {
20
+ assertMatches ("single item" , containsInAnyOrder (1 ), asList (1 ));
21
+ }
22
+
23
+ public void testDoesNotMatchEmpty () {
20
24
assertMismatchDescription ("iterable was []" , containsInAnyOrder (1 , 2 ), Collections .<Integer >emptyList ());
21
25
}
22
26
23
- public void testMatchesIterableOutOfOrder () throws Exception {
27
+ public void testMatchesIterableOutOfOrder () {
24
28
assertMatches ("Out of order" , containsInAnyOrder (1 , 2 ), asList (2 , 1 ));
25
29
}
26
30
27
- public void testMatchesIterableInOrder () throws Exception {
31
+ public void testMatchesIterableInOrder () {
28
32
assertMatches ("In order" , containsInAnyOrder (1 , 2 ), asList (1 , 2 ));
29
33
}
30
34
31
- public void testDoesNotMatchIfOneOfMultipleElementsMismatches () throws Exception {
35
+ public void testDoesNotMatchIfOneOfMultipleElementsMismatches () {
32
36
assertMismatchDescription ("iterable was [<1>, <2>, <4>]" , containsInAnyOrder (1 , 2 , 3 ), asList (1 , 2 , 4 ));
33
37
}
34
38
35
- public void testDoesNotMatchIfThereAreMoreElementsThanMatchers () throws Exception {
39
+ public void testDoesNotMatchIfThereAreMoreElementsThanMatchers () {
36
40
assertMismatchDescription ("iterable was [<1>, <2>, <3>, <4>]" , containsInAnyOrder (1 , 2 , 3 ), asList (1 , 2 , 3 , 4 ));
37
41
}
38
42
39
- public void testDoesNotMatchIfThereAreMoreMatchersThanElements () throws Exception {
43
+ public void testDoesNotMatchIfThereAreMoreMatchersThanElements () {
40
44
assertMismatchDescription ("iterable was [<1>, <2>, <3>]" , containsInAnyOrder (1 , 2 , 3 , 4 ), asList (1 , 2 , 3 ));
41
45
}
42
46
0 commit comments