Skip to content

Commit 4b37f86

Browse files
authored
Merge pull request #64 from ehrmann/validator-type-code-tests
Add simple tests for ValidatorTypeCode
2 parents 80791f8 + dc1baba commit 4b37f86

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.networknt.schema;
2+
3+
import static org.junit.Assert.assertEquals;
4+
import org.junit.Test;
5+
6+
public class ValidatorTypeCodeTest {
7+
8+
@Test
9+
public void testFromValueString() {
10+
assertEquals(ValidatorTypeCode.ADDITIONAL_PROPERTIES, ValidatorTypeCode.fromValue("additionalProperties"));
11+
}
12+
13+
@Test
14+
public void testFromValueAll() {
15+
for (ValidatorTypeCode code : ValidatorTypeCode.values()) {
16+
assertEquals(code, ValidatorTypeCode.fromValue(code.getValue()));
17+
}
18+
}
19+
20+
@Test(expected = IllegalArgumentException.class)
21+
public void testFromValueMissing() {
22+
assertEquals(ValidatorTypeCode.ADDITIONAL_PROPERTIES, ValidatorTypeCode.fromValue("missing"));
23+
}
24+
25+
}

0 commit comments

Comments
 (0)