Debian Codegraph @

src/test/java/ezvcard/property/KindTest.java

raw symbols SCIP
1 package ezvcard.property;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertFalse;
5 import static org.junit.Assert.assertTrue;
6
7 import org.junit.Test;
8
9 /*
10 Copyright (c) 2012-2023, Michael Angstadt
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15
16 1. Redistributions of source code must retain the above copyright notice, this
17 list of conditions and the following disclaimer.
18 2. Redistributions in binary form must reproduce the above copyright notice,
19 this list of conditions and the following disclaimer in the documentation
20 and/or other materials provided with the distribution.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33 The views and conclusions contained in the software and documentation are those
34 of the authors and should not be interpreted as representing official policies,
35 either expressed or implied, of the FreeBSD Project.
36 */
37
38 /**
39 * @author Michael Angstadt
40 */
41 public class KindTest {
42 @Test
43 public void isIndividual() {
44 Kind kind = new Kind("Individual");
45 assertTrue(kind.isIndividual());
46 assertFalse(kind.isGroup());
47 assertFalse(kind.isOrg());
48 assertFalse(kind.isLocation());
49 assertFalse(kind.isApplication());
50 assertFalse(kind.isDevice());
51 }
52
53 @Test
54 public void isGroup() {
55 Kind kind = new Kind("Group");
56 assertFalse(kind.isIndividual());
57 assertTrue(kind.isGroup());
58 assertFalse(kind.isOrg());
59 assertFalse(kind.isLocation());
60 assertFalse(kind.isApplication());
61 assertFalse(kind.isDevice());
62 }
63
64 @Test
65 public void isOrg() {
66 Kind kind = new Kind("Org");
67 assertFalse(kind.isIndividual());
68 assertFalse(kind.isGroup());
69 assertTrue(kind.isOrg());
70 assertFalse(kind.isLocation());
71 assertFalse(kind.isApplication());
72 assertFalse(kind.isDevice());
73 }
74
75 @Test
76 public void isLocation() {
77 Kind kind = new Kind("Location");
78 assertFalse(kind.isIndividual());
79 assertFalse(kind.isGroup());
80 assertFalse(kind.isOrg());
81 assertTrue(kind.isLocation());
82 assertFalse(kind.isApplication());
83 assertFalse(kind.isDevice());
84 }
85
86 @Test
87 public void isApplication() {
88 Kind kind = new Kind("Application");
89 assertFalse(kind.isIndividual());
90 assertFalse(kind.isGroup());
91 assertFalse(kind.isOrg());
92 assertFalse(kind.isLocation());
93 assertTrue(kind.isApplication());
94 assertFalse(kind.isDevice());
95 }
96
97 @Test
98 public void isDevice() {
99 Kind kind = new Kind("Device");
100 assertFalse(kind.isIndividual());
101 assertFalse(kind.isGroup());
102 assertFalse(kind.isOrg());
103 assertFalse(kind.isLocation());
104 assertFalse(kind.isApplication());
105 assertTrue(kind.isDevice());
106 }
107
108 @Test
109 public void individual() {
110 Kind kind = Kind.individual();
111 assertEquals("individual", kind.getValue());
112 }
113
114 @Test
115 public void group() {
116 Kind kind = Kind.group();
117 assertEquals("group", kind.getValue());
118 }
119
120 @Test
121 public void org() {
122 Kind kind = Kind.org();
123 assertEquals("org", kind.getValue());
124 }
125
126 @Test
127 public void location() {
128 Kind kind = Kind.location();
129 assertEquals("location", kind.getValue());
130 }
131
132 @Test
133 public void application() {
134 Kind kind = Kind.application();
135 assertEquals("application", kind.getValue());
136 }
137
138 @Test
139 public void device() {
140 Kind kind = Kind.device();
141 assertEquals("device", kind.getValue());
142 }
143 }