1 | /*
|
---|
2 | * To change this template, choose Tools | Templates
|
---|
3 | * and open the template in the editor.
|
---|
4 | */
|
---|
5 | package gov.hhs.fha.nhinc.util.format;
|
---|
6 |
|
---|
7 | import gov.hhs.fha.nhinc.nhinclib.NullChecker;
|
---|
8 | import java.util.*;
|
---|
9 | import org.junit.AfterClass;
|
---|
10 | import org.junit.BeforeClass;
|
---|
11 | import org.junit.Test;
|
---|
12 | import static org.junit.Assert.*;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | *
|
---|
16 | * @author rayj
|
---|
17 | */
|
---|
18 | public class DocumentClassCodeBuilderTest {
|
---|
19 |
|
---|
20 | public DocumentClassCodeBuilderTest() {
|
---|
21 | }
|
---|
22 |
|
---|
23 | @BeforeClass
|
---|
24 | public static void setUpClass() throws Exception {
|
---|
25 | }
|
---|
26 |
|
---|
27 | @AfterClass
|
---|
28 | public static void tearDownClass() throws Exception {
|
---|
29 | }
|
---|
30 |
|
---|
31 | @Test
|
---|
32 | public void BuildListWith3Items() {
|
---|
33 | List<String> documentClassCodeList = new ArrayList<String>();
|
---|
34 | documentClassCodeList.add("classcode1");
|
---|
35 | documentClassCodeList.add("classcode2");
|
---|
36 | documentClassCodeList.add("classcode3");
|
---|
37 | String classCodes = DocumentClassCodeParser.buildDocumentClassCodeItem(documentClassCodeList);
|
---|
38 | assertEquals("('classcode1','classcode2','classcode3')", classCodes);
|
---|
39 | }
|
---|
40 |
|
---|
41 | @Test
|
---|
42 | public void BuildListWith1Item() {
|
---|
43 | List<String> documentClassCodeList = new ArrayList<String>();
|
---|
44 | documentClassCodeList.add("classcode1");
|
---|
45 | String classCodes = DocumentClassCodeParser.buildDocumentClassCodeItem(documentClassCodeList);
|
---|
46 | assertEquals("('classcode1')", classCodes);
|
---|
47 | }
|
---|
48 |
|
---|
49 | @Test
|
---|
50 | public void BuildListWith0Items() {
|
---|
51 | List<String> documentClassCodeList = new ArrayList<String>();
|
---|
52 | String classCodes = DocumentClassCodeParser.buildDocumentClassCodeItem(documentClassCodeList);
|
---|
53 | assertEquals("", classCodes);
|
---|
54 | }
|
---|
55 |
|
---|
56 | @Test
|
---|
57 | public void BuildListWithNullInput() {
|
---|
58 | String classCodes = DocumentClassCodeParser.buildDocumentClassCodeItem(null);
|
---|
59 | assertEquals("", classCodes);
|
---|
60 | }
|
---|
61 | }
|
---|