Produced by Araxis Merge on 5/20/2019 8:52:19 AM 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 | PPMS_Build_11_Sprint_3.zip\CIF B11S3\VA.PPMS.IWS\VA.PPMS.IWS\VA.PPMS.IWS.Api.Unit.Test | CcnDataStreamControllerTests.cs | Wed Apr 17 20:03:42 2019 UTC |
| 2 | PPMS_Build_11_Sprint_3.zip\CIF B11S3\VA.PPMS.IWS\VA.PPMS.IWS\VA.PPMS.IWS.Api.Unit.Test | CcnDataStreamControllerTests.cs | Thu May 16 15:22:06 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 136 |
| 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 log4 net; | |
| 2 | using Micr osoft.AspN etCore.Mvc ; | |
| 3 | using Moq; | |
| 4 | using Syst em.Net; | |
| 5 | using Syst em.Net.Htt p; | |
| 6 | using Syst em.Threadi ng.Tasks; | |
| 7 | using VA.P PMS.IWS.Ap i.Configur ation.Inte rface; | |
| 8 | using VA.P PMS.IWS.Ap i.Controll ers; | |
| 9 | using VA.P PMS.IWS.Ap i.HttpClie ntHandler. Interface; | |
| 10 | using VA.P PMS.IWS.Co mmon; | |
| 11 | using Xuni t; | |
| 12 | ||
| 13 | namespace VA.PPMS.IW S.Api.Unit .Test | |
| 14 | { | |
| 15 | public class Ccn DataStream Controller Tests | |
| 16 | { | |
| 17 | [F act] | |
| 18 | pu blic void TestCcnDat aStreamRet urns201() | |
| 19 | { | |
| 20 | // Arran ge | |
| 21 | var mock Logger = n ew Mock<IL og>(); | |
| 22 | mockLogg er.Setup(x => x.Info (It.IsAny< object>()) ); | |
| 23 | mockLogg er.Setup(x => x.Erro r(It.IsAny <object>() )); | |
| 24 | ||
| 25 | var mock Configurat ion = new Mock<IIwsC onfigurati on>(); | |
| 26 | ||
| 27 | var mock Client = n ew Mock<IH ttpClientH andler>(); | |
| 28 | mockClie nt.Setup(x => x.Post Async(It.I sAny<strin g>(), It.I sAny<strin g>(), It.I sAny<DasMe ssage>())) .Returns(T ask.FromRe sult(new H ttpRespons eMessage(H ttpStatusC ode.Create d))); | |
| 29 | ||
| 30 | var cont roller = n ew CcnData StreamCont roller(moc kLogger.Ob ject, mock Configurat ion.Object , mockClie nt.Object) { Control lerContext = UnitTes tHelper.Cr eateContro llerContex t() }; | |
| 31 | ||
| 32 | const stri ng payload = "<p:Pro viders xml ns:p='http s:// DNS . URL /exchange/ ccn/1.0'>< Provider>< Correlatio nID /><Tra nsactionTy pe>Update< /Transacti onType><Fi rstName>An na</FirstN ame><LastN ame>Morgan -Test</Las tName><Pro viderId>10 03000225</ ProviderId ><HealthPr oviderType >Radiology </HealthPr oviderType ><Phone>51 0-752-1000 </Phone><I sAccepting NewPatient s>true</Is AcceptingN ewPatients ><IsPrimar yCareProvi der>true</ IsPrimaryC areProvide r><IsPrima ryCareProv iderAccept ingVa>true </IsPrimar yCareProvi derAccepti ngVa><Addr ess><Addre ss1>275 W MacArthur< /Address1> <City>Oakl and</City> <State>CA< /State><Po stalCode>9 4611</Post alCode><Co unty>Alame da</County ><CountryC ode>US</Co untryCode> </Address> <Npis><Ite m><Number> 1003000225 </Number>< EntityType Code>1-Ind ividual</E ntityTypeC ode></Item ></Npis><T ins><Item> <Number>48 1192138</N umber></It em></Tins> <Specialti es><Item>< CodedSpeci alty>17440 0000X</Cod edSpecialt y><IsPrima ryTaxonomy >true</IsP rimaryTaxo nomy></Ite m></Specia lties><Pro viderServi ces><Item> <Correlati onId /><Co dedSpecial ty>1744000 00X</Coded Specialty> <Location> <Correlati onId /><Na me>MacArth ur Medical (Test)</N ame><SiteA ddress><Ad dress1>275 W MacArth ur</Addres s1><City>O akland</Ci ty><State> CA</State> <PostalCod e>94611</P ostalCode> <County>Al ameda</Cou nty><Count ryCode>US< /CountryCo de></SiteA ddress></L ocation></ Item></Pro viderServi ces><Licen sures><Ite m><License Number>A92 262</Licen seNumber>< LicensingS tate>CA</L icensingSt ate><Expir ationDate> 2018-12-31 </Expirati onDate></I tem></Lice nsures></P rovider></ p:Provider s>"; | |
| 33 | ||
| 34 | // Act | |
| 35 | var resu lts = cont roller.Pos t(payload) ; | |
| 36 | var stat usCodeResu lt = resul ts.GetAwai ter().GetR esult() as StatusCod eResult; | |
| 37 | ||
| 38 | // Asser t | |
| 39 | Assert.N otNull(sta tusCodeRes ult); | |
| 40 | Assert.E qual(201, statusCode Result.Sta tusCode); | |
| 41 | } | |
| 42 | ||
| 43 | [F act] | |
| 44 | pu blic void TestCcnDat aStreamRet urns500() | |
| 45 | { | |
| 46 | // Arran ge | |
| 47 | var mock Logger = n ew Mock<IL og>(); | |
| 48 | mockLogg er.Setup(x => x.Info (It.IsAny< object>()) ); | |
| 49 | mockLogg er.Setup(x => x.Erro r(It.IsAny <object>() )); | |
| 50 | ||
| 51 | var mock Configurat ion = new Mock<IIwsC onfigurati on>(); | |
| 52 | ||
| 53 | var mock Client = n ew Mock<IH ttpClientH andler>(); | |
| 54 | mockClie nt.Setup(x => x.Post Async(It.I sAny<strin g>(), It.I sAny<strin g>(), It.I sAny<DasMe ssage>())) .Returns(T ask.FromRe sult(new H ttpRespons eMessage(H ttpStatusC ode.Intern alServerEr ror))); | |
| 55 | ||
| 56 | var cont roller = n ew CcnData StreamCont roller(moc kLogger.Ob ject, mock Configurat ion.Object , mockClie nt.Object) { Control lerContext = UnitTes tHelper.Cr eateContro llerContex t() }; | |
| 57 | ||
| 58 | const stri ng payload = "<p:Pro viders xml ns:p='http s:// DNS . URL /exchange/ ccn/1.0'>< Provider>< Correlatio nID /><Tra nsactionTy pe>Update< /Transacti onType><Fi rstName>An na</FirstN ame><LastN ame>Morgan -Test</Las tName><Pro viderId>10 03000225</ ProviderId ><HealthPr oviderType >Radiology </HealthPr oviderType ><Phone>51 0-752-1000 </Phone><I sAccepting NewPatient s>true</Is AcceptingN ewPatients ><IsPrimar yCareProvi der>true</ IsPrimaryC areProvide r><IsPrima ryCareProv iderAccept ingVa>true </IsPrimar yCareProvi derAccepti ngVa><Addr ess><Addre ss1>275 W MacArthur< /Address1> <City>Oakl and</City> <State>CA< /State><Po stalCode>9 4611</Post alCode><Co unty>Alame da</County ><CountryC ode>US</Co untryCode> </Address> <Npis><Ite m><Number> 1003000225 </Number>< EntityType Code>1-Ind ividual</E ntityTypeC ode></Item ></Npis><T ins><Item> <Number>48 1192138</N umber></It em></Tins> <Specialti es><Item>< CodedSpeci alty>17440 0000X</Cod edSpecialt y><IsPrima ryTaxonomy >true</IsP rimaryTaxo nomy></Ite m></Specia lties><Pro viderServi ces><Item> <Correlati onId /><Co dedSpecial ty>1744000 00X</Coded Specialty> <Location> <Correlati onId /><Na me>MacArth ur Medical (Test)</N ame><SiteA ddress><Ad dress1>275 W MacArth ur</Addres s1><City>O akland</Ci ty><State> CA</State> <PostalCod e>94611</P ostalCode> <County>Al ameda</Cou nty><Count ryCode>US< /CountryCo de></SiteA ddress></L ocation></ Item></Pro viderServi ces><Licen sures><Ite m><License Number>A92 262</Licen seNumber>< LicensingS tate>CA</L icensingSt ate><Expir ationDate> 2018-12-31 </Expirati onDate></I tem></Lice nsures></P rovider></ p:Provider s>"; | |
| 59 | ||
| 60 | // Act | |
| 61 | var resu lts = cont roller.Pos t(payload) ; | |
| 62 | var stat usCodeResu lt = resul ts.GetAwai ter().GetR esult() as ObjectRes ult; | |
| 63 | ||
| 64 | // Asser t | |
| 65 | Assert.N otNull(sta tusCodeRes ult); | |
| 66 | Assert.E qual(500, statusCode Result.Sta tusCode); | |
| 67 | Assert.E qual("Unab le to proc ess Provid ers for tr ansaction: F911B4D4- BDB7-410C- 8266-3EF4C D8DDD6F", statusCode Result.Val ue); | |
| 68 | } | |
| 69 | } | |
| 70 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.