Produced by Araxis Merge on 4/7/2019 7:13:56 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | MHLTH_CLOZ_MOD _SRC.zip\MHLTH_CLOZ_MOD _SRC\Releases\ClozMod_Build5_.zip\Va.Gov.Nccc.Registry.Tests\Controllers | HL7MessagesControllerTests.cs | Mon Mar 4 20:33:52 2019 UTC |
2 | MHLTH_CLOZ_MOD _SRC.zip\MHLTH_CLOZ_MOD _SRC\Releases\ClozMod_Build5_.zip\Va.Gov.Nccc.Registry.Tests\Controllers | HL7MessagesControllerTests.cs | Fri Apr 5 18:34:24 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 264 |
Changed | 2 | 4 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | using Syst em; | |
2 | using Syst em.Web.Mvc ; | |
3 | using Micr osoft.Visu alStudio.T estTools.U nitTesting ; | |
4 | using Moq; | |
5 | using Va.G ov.Nccc.Da ta.Common. Hl7Message s; | |
6 | using Va.G ov.Nccc.Da ta.Common. Repository ; | |
7 | using Va.G ov.Nccc.Re gistry.Con trollers; | |
8 | using Va.G ov.Nccc.Re gistry.Mod els.HL7Mes sages; | |
9 | using Syst em.Data.En tity; | |
10 | using Syst em.Compone ntModel; | |
11 | using Va.G ov.Nccc.Da ta.Common. Results; | |
12 | ||
13 | namespace Va.Gov.Ncc c.Registry .Tests.Con trollers | |
14 | { | |
15 | [TestC lass] | |
16 | public class HL7 MessagesCo ntrollerTe sts | |
17 | { | |
18 | HL 7MessagesC ontroller controller SystemUnde rTest; | |
19 | HL 7MessagesL istViewMod el modelTo BePassedTo SystemUnde rTest; | |
20 | HL 7DetailsVi ewModel de tailsViewM odel; | |
21 | Mo ck<IReposi tory> mock NcccReposi tory; | |
22 | Mo ck<IHl7Mes sagesRepos itory> moc kIHl7Messa gesReposit ory; | |
23 | ||
24 | [T estInitial ize] | |
25 | pu blic void TestInit() | |
26 | { | |
27 | // Mock out our us er reposit ory (a fak e concrete instance) | |
28 | mockIHl7 MessagesRe pository = new Mock< IHl7Messag esReposito ry>(MockBe havior.Loo se); | |
29 | ||
30 | // Mock out our la rger repos itory (tha t collects all the r epositorie s) | |
31 | mockNccc Repository = new Moc k<IReposit ory>(MockB ehavior.Lo ose); | |
32 | ||
33 | // Set u p the meth od for the larger re pository t hat calls the smalle r reposito ry | |
34 | mockNccc Repository .Setup(x = > x.HL7Mes sages).Ret urns(mockI Hl7Message sRepositor y.Object); | |
35 | ||
36 | // Creat e a concre te instanc e of the s ystem we w ill be tes ting | |
37 | controll erSystemUn derTest = new HL7Mes sagesContr oller(mock NcccReposi tory.Objec t); | |
38 | ||
39 | // Pass a concrete ViewModel to the co ntroller | |
40 | modelToB ePassedToS ystemUnder Test = new HL7Messag esListView Model(); | |
41 | } | |
42 | ||
43 | [T estMethod] | |
44 | pu blic void IndexSucce ss_NoSearc h() | |
45 | { | |
46 | // Arran ge | |
47 | mockIHl7 MessagesRe pository.S etup(x => x.ReadAllI ndex(It.Is Any<int>() , It.IsAny <int>(), I t.IsAny<Li stSortDire ction>(), It.IsAny<s tring>(), It.IsAny<D ateTime>() )).Returns (new Paged ListResult <Hl7Messag eDump> | |
48 | { | |
49 | List = new Sys tem.Collec tions.Gene ric.List<H l7MessageD ump> | |
50 | { | |
51 | new Hl7Mes sageDump | |
52 | { | |
53 | Id = 1 , | |
54 | Conten t = "", | |
55 | Reciev ed = DateT ime.Now, | |
56 | Proces sed = Date Time.Now | |
57 | } | |
58 | }, | |
59 | Succ ess = true | |
60 | }); | |
61 | ||
62 | //Act | |
63 | ActionRe sult resul t = contro llerSystem UnderTest. Index(It.I sAny<int>( ), It.IsAn y<int>(), It.IsAny<s tring>(), It.IsAny<s tring>()); | |
64 | ||
65 | //Assert | |
66 | Assert.I sNotNull(r esult); | |
67 | Assert.I sInstanceO fType(resu lt, typeof (ActionRes ult)); | |
68 | } | |
69 | ||
70 | [T estMethod] | |
71 | pu blic void IndexFail_ NoSearch() | |
72 | { | |
73 | // Arran ge | |
74 | mockIHl7 MessagesRe pository.S etup(x => x.ReadAllI ndex(It.Is Any<int>() , It.IsAny <int>(), I t.IsAny<Li stSortDire ction>(), It.IsAny<s tring>(), It.IsAny<D ateTime>() )).Returns (new Paged ListResult <Hl7Messag eDump> | |
75 | { | |
76 | Succ ess = fals e | |
77 | }); | |
78 | ||
79 | //Act | |
80 | ActionRe sult resul t = contro llerSystem UnderTest. Index(It.I sAny<int>( ), It.IsAn y<int>(), It.IsAny<s tring>(), It.IsAny<s tring>()); | |
81 | ||
82 | //Assert | |
83 | Assert.I sNotNull(r esult); | |
84 | Assert.I sInstanceO fType(resu lt, typeof (ActionRes ult)); | |
85 | } | |
86 | ||
87 | [T estMethod] | |
88 | pu blic void DetailsSuc cess() | |
89 | { | |
90 | //Arrang e | |
91 | string c ontent = @ "MSH|^~\&| Our System |Our Facil ity|Their Remote Sys tem|Their Remote Fac ility|2018 0919201233 ||ADT^A01| 1234201809 19201233|P |2.3 | |
92 | EVN|A01| 2018091920 1233 | |
93 | PID|3787 85433211|| ||Mouse^Mi ckey|||||| 123 Main S treet^^Lak e Buena Vi sta^FL^^US A | |
94 | PV1||O|S ome Point of Care^^^ Some Treat ment Facil ity|ALERT| |||9999999 9^Smith^Ja ck^^^^^^^^ ^^456789|| |||||||||| |||||||||| |||||||||| ||||201809 19201233"; | |
95 | ||
96 | ||
97 | //Act | |
98 | ActionRe sult resul t = contro llerSystem UnderTest. Details(1, content, DateTime.N ow); | |
99 | ||
100 | //Assert | |
101 | Assert.I sNotNull(r esult); | |
102 | Assert.I sInstanceO fType(resu lt, typeof (ActionRes ult)); | |
103 | } | |
104 | ||
105 | [T estMethod] | |
106 | pu blic void DetailsSuc cess_ADTMe ssage() | |
107 | { | |
108 | //Arrang e | |
109 | string con tent = @"M SH|^~\&|YS CL CLOZ RE GISTRY|500 ^ DN S
|
|
110 | ||
111 | //Act | |
112 | ActionRe sult resul t = contro llerSystem UnderTest. Details(1, content, DateTime.N ow); | |
113 | ||
114 | //Assert | |
115 | Assert.I sNotNull(r esult); | |
116 | Assert.I sInstanceO fType(resu lt, typeof (ActionRes ult)); | |
117 | } | |
118 | ||
119 | [T estMethod] | |
120 | pu blic void DetailsSuc cess_RDEMe ssage() | |
121 | { | |
122 | //Arrang e | |
123 | string con tent = @"M SH|^~\&|YS CL CLOZ RE GISTRY|402 ^ DN S
|
|
124 | PID|||11 2345567^^^ ^SS~VA1234 5^^^^PN~10 00720100V2 71387^^^^N I~12345678 9^^^^PI||D OE^JOHN^^^ ^^L||19700 101|M||202 8-9^Asian| ^^^^02196| |||||||||| H^Hispanic or Latino PV1||O OR C|RE|||||| ||20181212 |||2345678 91^Lastnam e^Firstnam e^^^^^^^^^ ^NPI RXE|| ^^^64725-1 260^Clozar il^NDC|100 ||MG||9^PR ESCRIBER A PPROVED 4 DAY SUPPLY ^^1^Weathe r related condition| |||||||135 19100||||| |||||||||| |||||||||| 123456789^ NCPDP TQ1| 1| RXR|PO^ ORAL"; | |
125 | ||
126 | //Act | |
127 | ActionRe sult resul t = contro llerSystem UnderTest. Details(1, content, DateTime.N ow); | |
128 | ||
129 | //Assert | |
130 | Assert.I sNotNull(r esult); | |
131 | Assert.I sInstanceO fType(resu lt, typeof (ActionRes ult)); | |
132 | } | |
133 | } | |
134 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.