Produced by Araxis Merge on 4/12/2018 7:40:39 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 | AHOBPRe_v4.4.17_bld4.zip\Web Services\AHOBPR_RESTful_Service\WCF_BusinessManagerAHOBPRTests\EMIS | DoDManagerTests.cs | Tue Apr 10 16:46:49 2018 UTC |
| 2 | AHOBPRe_v4.4.17_bld4.zip\Web Services\AHOBPR_RESTful_Service\WCF_BusinessManagerAHOBPRTests\EMIS | DoDManagerTests.cs | Thu Apr 12 23:03:47 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 360 |
| Changed | 1 | 2 |
| 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 Micr osoft.Visu alStudio.T estTools.U nitTesting ; | |
| 2 | using Syst em; | |
| 3 | using Syst em.Collect ions.Gener ic; | |
| 4 | using Syst em.Linq; | |
| 5 | using Syst em.Diagnos tics; | |
| 6 | using Vete ransAffair s.Registri es.Busines sManagerAH OBPR.Emis; | |
| 7 | ||
| 8 | using Vete ransAffair s.Registri es.Busines sAHOBPR; | |
| 9 | using PS = VeteransA ffairs.Reg istries.Bu sinessAHOB PR.Payment Service; | |
| 10 | using Vete ransAffair s.Registri es.Busines sManagerAH OBPR; | |
| 11 | ||
| 12 | namespace WCF_Busine ssManagerA HOBPRTests .EMIS | |
| 13 | { | |
| 14 | [TestC lass] | |
| 15 | public class DoD ManagerTes ts | |
| 16 | { | |
| 17 | string con = "Data S ource= DN S
|
|
| 18 | [T estMethod] | |
| 19 | pu blic void ProcessDep loymentsAd dsNewDeplo ymentsFrom Emis() | |
| 20 | { | |
| 21 | var edi pi = "1005 136624"; | |
| 22 | Registra ntHistory history = CreateRegi strantHist ory(); | |
| 23 | var cut = new Regi strantDepl oymentMana ger(con); | |
| 24 | var fact ory = new Registrant Deployment Factory(co n); | |
| 25 | ||
| 26 | List<IDe ployment> deployment s = new Do DDeploymen tImporter( ).GetRegis trantDeplo yments(his tory, edip i, factory ); | |
| 27 | ||
| 28 | var actu al = cut.P rocessDepl oyments(de ployments, 45725, hi story); | |
| 29 | Assert.A reEqual(tr ue, actual ); | |
| 30 | } | |
| 31 | ||
| 32 | [T estMethod] | |
| 33 | pu blic void ProcessDep loymentsUp datesRegis trantEnter edDeployme nts() | |
| 34 | { | |
| 35 | var edip i = "10051 36624"; | |
| 36 | ||
| 37 | Registra ntHistory history = CreateRegi strantHist ory(); | |
| 38 | history. PaymentDat aByDateTim e = Create PettyOffic erPayData( ); | |
| 39 | ||
| 40 | var cut = new Regi strantDepl oymentMana ger(con); | |
| 41 | var fact ory = new Registrant Deployment Factory(co n); | |
| 42 | ||
| 43 | List<IDe ployment> deployment s = new Do DDeploymen tImporter( ).GetRegis trantDeplo yments(his tory, edip i, factory ); | |
| 44 | Trace.Wr iteLine($" Number of Deployment s: {deploy ments.Coun t()}\nGoin g into Tes t"); | |
| 45 | ||
| 46 | var actu al = cut.P rocessDepl oyments(de ployments, 45725, hi story); | |
| 47 | Assert.A reEqual(tr ue, actual ); | |
| 48 | } | |
| 49 | ||
| 50 | pr ivate stat ic Diction ary<DateTi me, PS.Pay GradeHisto ryData> Cr eatePettyO fficerPayD ata() | |
| 51 | { | |
| 52 | ||
| 53 | return n ew Diction ary<DateTi me, PS.Pay GradeHisto ryData> | |
| 54 | { | |
| 55 | { Da teTime.Par se("2012-0 5-12"), | |
| 56 | new PS.PayGrad eHistoryDa ta | |
| 57 | { | |
| 58 | payPlanCod e = "ME", | |
| 59 | PayGradeCo de = "04", | |
| 60 | serviceRan kNameTxt = "Petty Of ficer Thir d Class", | |
| 61 | serviceRan kNameCode = "PO3", | |
| 62 | payGradeDa te = DateT ime.Parse( "2012-05-1 2") | |
| 63 | } }, | |
| 64 | ||
| 65 | { D ateTime.Pa rse("2008- 08-15"), | |
| 66 | ne w PS.PayGr adeHistory Data | |
| 67 | { | |
| 68 | payPlanCod e = "ME", | |
| 69 | PayGradeCo de = "03", | |
| 70 | serviceRan kNameTxt = "Seaman", | |
| 71 | serviceRan kNameCode = "SN", | |
| 72 | payGradeDa te = DateT ime.Parse( "2008-08-1 5") | |
| 73 | } }, | |
| 74 | { DateTime. Parse("200 2-04-07"), | |
| 75 | new PS.PayGrad eHistoryDa ta | |
| 76 | { | |
| 77 | payPlanCod e = "ME", | |
| 78 | PayGradeCo de = "02", | |
| 79 | serviceRan kNameTxt = "Seaman A pprentice" , | |
| 80 | serviceRan kNameCode = "SA", | |
| 81 | payGradeDa te = DateT ime.Parse( "2002-04-0 7") | |
| 82 | } }, | |
| 83 | { DateTim e.Parse("1 994-04-07" ), | |
| 84 | new PS.PayGrad eHistoryDa ta | |
| 85 | { | |
| 86 | payPlanCod e = "ME", | |
| 87 | PayGradeCo de = "02", | |
| 88 | serviceRan kNameTxt = "Seaman A pprentice" , | |
| 89 | serviceRan kNameCode = "SA", | |
| 90 | payGradeDa te = DateT ime.Parse( "1994-04-0 7") | |
| 91 | } }, | |
| 92 | }; | |
| 93 | ||
| 94 | } | |
| 95 | pr ivate stat ic Registr antHistory CreateReg istrantHis tory() | |
| 96 | { | |
| 97 | Registra ntHistory history = new Regist rantHistor y(); | |
| 98 | var pers onnelCateg oryCodes = new Dicti onary<Date Range, str ing> | |
| 99 | { | |
| 100 | { ne w DateRang e(DateTime .Parse("4/ 7/2002 12: 00:00 AM") , DateTime .Parse("11 /11/9999 1 2:00:00 AM ")), "V"}, | |
| 101 | { ne w DateRang e(DateTime .Parse("4/ 7/1983 12: 00:00 AM") , DateTime .Parse("1/ 23/1992 12 :00:00 AM" )), "A"} | |
| 102 | }; | |
| 103 | var payP lan = new Dictionary <DateTime, PS.PayGra deHistoryD ata> | |
| 104 | { | |
| 105 | { Da teTime.Par se("2009-1 1-15"), | |
| 106 | new PS.PayGrad eHistoryDa ta | |
| 107 | { | |
| 108 | payPlanCod e = "ME", | |
| 109 | PayGradeCo de = "05", | |
| 110 | serviceRan kNameTxt = "Sergeant ", | |
| 111 | serviceRan kNameCode = "SGT", | |
| 112 | payGradeDa te = DateT ime.Parse( "2009-11-1 5") | |
| 113 | } } | |
| 114 | }; | |
| 115 | ||
| 116 | var occu pations = new Sorted Dictionary <DateTime, List<Serv iceSpecifi cOccupatio n>>{ | |
| 117 | { Da teTime.Par se("3/31/2 014 12:00: 00 AM"), | |
| 118 | new Li st<Service SpecificOc cupation>{ | |
| 119 | new Serv iceSpecifi cOccupatio n{Occupati onId = 126 38, StartD ate = Date Time.Parse ("3/31/201 4 12:00:00 AM"), Typ e = 'P'} | |
| 120 | ,new Serv iceSpecifi cOccupatio n{Occupati onId = 127 67, StartD ate = Date Time.Parse ("3/31/201 4 12:00:00 AM"), Typ e = 'S'} | |
| 121 | } | |
| 122 | }, | |
| 123 | { D ateTime.Pa rse("5/12/ 2012 12:00 :00 AM"), | |
| 124 | new Li st<Service SpecificOc cupation>{ | |
| 125 | new Serv iceSpecifi cOccupatio n{Occupati onId = 119 4, StartDa te = DateT ime.Parse( "4/7/1983 12:00:00 A M"), Type = 'P'} | |
| 126 | } | |
| 127 | }, | |
| 128 | { D ateTime.Pa rse("8/15/ 2008 12:00 :00 AM"), | |
| 129 | new Li st<Service SpecificOc cupation>{ | |
| 130 | new Serv iceSpecifi cOccupatio n{Occupati onId = 116 4, StartDa te = DateT ime.Parse( "4/7/1983 12:00:00 A M"), Type = 'P'} | |
| 131 | } | |
| 132 | }, | |
| 133 | { D ateTime.Pa rse("8/15/ 2003 12:00 :00 AM"), | |
| 134 | new Li st<Service SpecificOc cupation>{ | |
| 135 | new Serv iceSpecifi cOccupatio n{Occupati onId = 112 2, StartDa te = DateT ime.Parse( "4/7/1983 12:00:00 A M"), Type = 'D'} | |
| 136 | } | |
| 137 | }, | |
| 138 | { D ateTime.Pa rse("4/7/1 989 12:00: 00 AM"), | |
| 139 | new Li st<Service SpecificOc cupation>{ | |
| 140 | new Serv iceSpecifi cOccupatio n{Occupati onId = 836 9, StartDa te = DateT ime.Parse( "4/7/1983 12:00:00 A M"), Type = 'D'} | |
| 141 | } | |
| 142 | }, | |
| 143 | { Da teTime.Par se("4/7/19 83 12:00:0 0 AM"), | |
| 144 | new Li st<Service SpecificOc cupation>{ | |
| 145 | new Serv iceSpecifi cOccupatio n{Occupati onId = 283 4, StartDa te = DateT ime.Parse( "4/7/1983 12:00:00 A M"), Type = 'P'} | |
| 146 | } | |
| 147 | } | |
| 148 | }; | |
| 149 | //var sv cEpisodeSt art = Date Time.Parse ("2010-08- 20"); | |
| 150 | //var sv cEpisodeEn d = DateTi me.Parse(" 2015-08-13 "); | |
| 151 | // var svcDateRan ge = new D ateRange(s vcEpisodeS tart, svcE pisodeEnd) ; | |
| 152 | Dictiona ry<DateRan ge, string > svcEpiso des = new Dictionary <DateRange , string> | |
| 153 | { | |
| 154 | {new D ateRange(D ateTime.Pa rse("4/7/2 002"), Dat eTime.Pars e("11/11/9 999")), "N "}, | |
| 155 | {new D ateRange(D ateTime.Pa rse("1/26/ 1992"), Da teTime.Par se("1/23/2 001")), "N "}, | |
| 156 | {new D ateRange(D ateTime.Pa rse("4/7/1 983"), Dat eTime.Pars e("1/23/19 92")), "N" } | |
| 157 | }; | |
| 158 | history. BranchesOf Service = svcEpisode s; | |
| 159 | history. Occupation sByDateTim e = occupa tions; | |
| 160 | history. PaymentDat aByDateTim e = payPla n; | |
| 161 | history. PersonnelC ategoryCod esByDateRa nge = pers onnelCateg oryCodes; | |
| 162 | return h istory; | |
| 163 | } | |
| 164 | ||
| 165 | // / <summary > | |
| 166 | // / Helper m ethod to u se Emis to generate test data | |
| 167 | // / </summar y> | |
| 168 | // / <param n ame="branc hesOfServi ce"></para m> | |
| 169 | // private vo id WriteBr anchesOfSe rvice(Dict ionary<Dat eRange, st ring> bran chesOfServ ice) | |
| 170 | // { | |
| 171 | // if (br anchesOfSe rvice == n ull) throw new Argum entNullExc eption(nam eof(branch esOfServic e)); | |
| 172 | // Consol e.WriteLin e("new Dic tionary<Da teRange, s tring>{"); | |
| 173 | // foreac h (KeyValu ePair<Date Range, str ing> kvp i n branches OfService) | |
| 174 | // { | |
| 175 | // Co nsole.Writ e($"{{new DateRange( DateTime.P arse(\"{kv p.Key.Star t.ToShortD ateString( )}\")), ") ; | |
| 176 | // Co nsole.Writ eLine($"Da teTime.Par se(\"{ kvp .Key.End.T oShortDate String()}\ "), \"{kvp .Value}\"} },"); | |
| 177 | // } | |
| 178 | // Consol e.WriteLin e("};"); | |
| 179 | // } | |
| 180 | } | |
| 181 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.