1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.de.smartics.properties.api.core.domain;
17
18 import static org.hamcrest.MatcherAssert.assertThat;
19 import static org.hamcrest.Matchers.is;
20 import static org.hamcrest.Matchers.nullValue;
21 import static org.junit.Assert.assertSame;
22
23 import org.junit.Test;
24 import org.junit.experimental.categories.Category;
25
26 import de.smartics.properties.api.core.domain.PropertyExpression;
27 import de.smartics.testdoc.annotations.Uut;
28 import de.smartics.testdoc.categories.type.Construction;
29
30
31
32
33 @Category(Construction.class)
34 @Uut(type = PropertyExpression.class)
35 public class PropertyExpressionTest
36 {
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 @Test
54 public void createsANonBlankExpression()
55 {
56 final String expression = "${test}";
57 final PropertyExpression uut = PropertyExpression.create(expression);
58
59 assertThat(uut.hasExpression(), is(true));
60 assertThat(uut.getExpression(), is(expression));
61 assertThat(uut.toString(), is(expression));
62 }
63
64 @Test
65 public void createsABlankExpression()
66 {
67 final String expression = " ";
68 final PropertyExpression uut = PropertyExpression.create(expression);
69
70 assertThat(uut.hasExpression(), is(false));
71 assertThat(uut.getExpression(), is(nullValue()));
72 assertThat(uut.toString(), is(""));
73 assertSame(PropertyExpression.NO_EXPRESSION, uut);
74 }
75 }