1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.de.smartics.properties.spi.core.value;
17
18 import static org.hamcrest.MatcherAssert.assertThat;
19 import static org.hamcrest.Matchers.equalTo;
20 import static org.hamcrest.Matchers.is;
21
22 import java.util.List;
23
24 import org.junit.Before;
25 import org.junit.Test;
26
27 import de.smartics.properties.spi.core.value.CollectionPropertyValueRange;
28 import de.smartics.testdoc.annotations.Uut;
29
30
31
32
33 @Uut(type = CollectionPropertyValueRange.class)
34 public class CollectionPropertyValueRangeWithNoElementArrayTest
35 {
36
37
38
39
40
41
42 private CollectionPropertyValueRange<String> uut;
43
44
45
46
47
48
49
50 @Before
51 public void setUp()
52 {
53 uut = new CollectionPropertyValueRange<String>(new String[0]);
54 }
55
56
57
58
59
60 @Test
61 public void providesAStringRepresentation()
62 {
63 final String result = uut.toString();
64
65 assertThat(result, is(equalTo("")));
66 }
67
68 @Test(expected = IllegalArgumentException.class)
69 public void signalsRequestOfUnknownElementWithAnException()
70 {
71 final String elementName = "unknown-element-name";
72 uut.fromString(elementName);
73 }
74
75 @Test
76 public void allowsToRetrieveAllValues()
77 {
78 final List<String> values = uut.getValues();
79
80 assertThat(values.isEmpty(), is(true));
81 }
82 }