source: EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientCheckVO.as@ 1227

Last change on this file since 1227 was 1227, checked in by George Lilly, 13 years ago

initial load of EDIS 1.0

File size: 1.9 KB
Line 
1package gov.va.med.edp.pt.demog.model {
2import gov.va.med.edp.pt.demog.*;
3
4import flexunit.framework.TestCase;
5import mx.collections.ArrayCollection;
6
7public 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}
Note: See TracBrowser for help on using the repository browser.