1 | package gov.va.med.edp.pt.demog.model {
|
---|
2 | import gov.va.med.edp.pt.demog.*;
|
---|
3 |
|
---|
4 | import flexunit.framework.TestCase;
|
---|
5 | import mx.collections.ArrayCollection;
|
---|
6 |
|
---|
7 | public class TestPatientCheckVO extends TestCase {
|
---|
8 |
|
---|
9 | public function testOnBoard():void {
|
---|
10 | var c:PatientCheckVO = new PatientCheckVO();
|
---|
11 | assertFalse(c.isOnBoard());
|
---|
12 | c.onBoardText = "foo";
|
---|
13 | assertTrue(c.isOnBoard());
|
---|
14 | }
|
---|
15 |
|
---|
16 | public function testIsDeceased():void {
|
---|
17 | var c:PatientCheckVO = new PatientCheckVO();
|
---|
18 | assertFalse(c.isOnBoard());
|
---|
19 | c.deceasedText = "foo";
|
---|
20 | assertTrue(c.isDeceased());
|
---|
21 | }
|
---|
22 |
|
---|
23 | public function testHasSimilarNames():void {
|
---|
24 | var c:PatientCheckVO = new PatientCheckVO();
|
---|
25 | assertFalse(c.hasSimilarNames());
|
---|
26 | c.similarNames = [];
|
---|
27 | assertFalse(c.hasSimilarNames());
|
---|
28 | c.similarNames = createPtList();
|
---|
29 | assertTrue(c.hasSimilarNames());
|
---|
30 | }
|
---|
31 |
|
---|
32 | public function testHasFlags():void {
|
---|
33 | var c:PatientCheckVO = new PatientCheckVO();
|
---|
34 | assertFalse(c.hasFlags());
|
---|
35 | c.flags = new ArrayCollection();
|
---|
36 | assertFalse(c.hasFlags());
|
---|
37 | c.flags = createPtFlags();
|
---|
38 | assertTrue(c.hasFlags());
|
---|
39 | }
|
---|
40 |
|
---|
41 | public static function createPtList():Array {
|
---|
42 | var pt1:PatientSelectVO = new PatientSelectVO();
|
---|
43 | pt1.dfn = "fefefef"
|
---|
44 |
|
---|
45 | var pt2:PatientSelectVO = new PatientSelectVO();
|
---|
46 | pt2.dfn = "efeerfer";
|
---|
47 |
|
---|
48 | var pt3:PatientSelectVO = new PatientSelectVO();
|
---|
49 | pt3.dfn = "fe34ef"
|
---|
50 |
|
---|
51 | return [pt1, pt2, pt3];
|
---|
52 | }
|
---|
53 |
|
---|
54 | public static function createPtFlags():ArrayCollection {
|
---|
55 | var flag1:PatientRecordFlagVO = new PatientRecordFlagVO();
|
---|
56 | flag1.name = "foo";
|
---|
57 | flag1.type = "bar";
|
---|
58 | flag1.status = "baz";
|
---|
59 |
|
---|
60 | var flags:ArrayCollection = new ArrayCollection();
|
---|
61 | flags.addItem(flag1);
|
---|
62 | return flags;
|
---|
63 | }
|
---|
64 | }
|
---|
65 | }
|
---|