From e698f54dc7d225a3d21a24d7288056d08998781c Mon Sep 17 00:00:00 2001 From: blsonalib Date: Tue, 17 Dec 2019 12:37:07 +0530 Subject: [PATCH] Added test case for ride ripository --- .../executionHistory/executionHistory.bin | Bin 124890 -> 163923 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 38 bytes .gradle/5.2.1/fileContent/fileContent.lock | Bin 17 -> 38 bytes .gradle/5.2.1/fileHashes/fileHashes.bin | Bin 20897 -> 21247 bytes .gradle/5.2.1/fileHashes/fileHashes.lock | Bin 17 -> 38 bytes .../5.2.1/fileHashes/resourceHashesCache.bin | Bin 19143 -> 19347 bytes .gradle/5.2.1/javaCompile/classAnalysis.bin | Bin 22398 -> 24681 bytes .gradle/5.2.1/javaCompile/jarAnalysis.bin | Bin 20756 -> 22641 bytes .gradle/5.2.1/javaCompile/javaCompile.lock | Bin 17 -> 38 bytes .gradle/5.2.1/javaCompile/taskHistory.bin | Bin 19110 -> 19110 bytes .../buildOutputCleanup.lock | Bin 17 -> 38 bytes .idea/workspace.xml | 61 ++++-- .../CabServiceException$ExceptionType.class | Bin 0 -> 1272 bytes .../CabServiceException.class | Bin 0 -> 1242 bytes .../cabinvoicegenerator/InVoiceService.class | Bin 2305 -> 2387 bytes .../cabinvoicegenerator/RideRepository.class | Bin 1321 -> 1854 bytes .../InvoiceServiceTest.class | Bin 3608 -> 3678 bytes .../RideRepositoryTest.class | Bin 0 -> 1589 bytes ...abinvoicegenerator.InvoiceServiceTest.html | 142 ------------- build/reports/tests/test/css/base-style.css | 179 ---------------- build/reports/tests/test/css/style.css | 84 -------- build/reports/tests/test/index.html | 133 ------------ build/reports/tests/test/js/report.js | 194 ------------------ .../packages/com.cabinvoicegenerator.html | 103 ---------- ...cabinvoicegenerator.InvoiceServiceTest.xml | 16 -- build/test-results/test/binary/output.bin | 2 - build/test-results/test/binary/output.bin.idx | Bin 69 -> 0 bytes build/test-results/test/binary/results.bin | Bin 1086 -> 0 bytes .../CabServiceException.java | 25 +++ .../cabinvoicegenerator/InVoiceService.java | 4 +- .../cabinvoicegenerator/RideRepository.java | 26 ++- .../InvoiceServiceTest.java | 5 +- .../RideRepositoryTest.java | 24 +++ 33 files changed, 111 insertions(+), 887 deletions(-) create mode 100644 build/classes/java/main/com/cabinvoicegenerator/CabServiceException$ExceptionType.class create mode 100644 build/classes/java/main/com/cabinvoicegenerator/CabServiceException.class create mode 100644 build/classes/java/test/com/cabinvoicegenerator/RideRepositoryTest.class delete mode 100644 build/reports/tests/test/classes/com.cabinvoicegenerator.InvoiceServiceTest.html delete mode 100644 build/reports/tests/test/css/base-style.css delete mode 100644 build/reports/tests/test/css/style.css delete mode 100644 build/reports/tests/test/index.html delete mode 100644 build/reports/tests/test/js/report.js delete mode 100644 build/reports/tests/test/packages/com.cabinvoicegenerator.html delete mode 100644 build/test-results/test/TEST-com.cabinvoicegenerator.InvoiceServiceTest.xml delete mode 100644 build/test-results/test/binary/output.bin.idx delete mode 100644 build/test-results/test/binary/results.bin create mode 100644 src/main/java/com/cabinvoicegenerator/CabServiceException.java create mode 100644 src/test/java/com/cabinvoicegenerator/RideRepositoryTest.java diff --git a/.gradle/5.2.1/executionHistory/executionHistory.bin b/.gradle/5.2.1/executionHistory/executionHistory.bin index ab46769075f05b93f4bcd3903e06732acc4e8aaf..f5303bda4f17ab4d233a2389229927cb440e48b7 100644 GIT binary patch delta 5981 zcmeHL2~-o;8qQ7RDVruimVgvfcady_pi~rvsMw0AD2UG^StcZqgfNrD1hG|%&s~A3 z9efcXDhen?h#D*6img@<6=|(YtAHDIr$=zZH;LdvuZ2VyVlHeNbd<8GF+qk5eQ%>LLji?36=v~Jxd^P@Qe6Cq&+1N{N3@h6(z}w-BFrH zGKo0B&9uT}%EUn~MgqabXps4<)LfM`NdyZeVsS!%OvsgK5vfQev!);r80bVP-xMKr zC6Vk85K+2(`tVSJa0&!#Wg>{L6G1AqEJ@k-`B{`+1u;Z&0fLao59mL5`I7Esui5w8 zv4V2pM6e&A6om)rm}c25ZMsR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_~k$)z> z*c~qL#`b&MRSEMos@O*>s z?p2%H<^IZ`PQ*Z`kdw$ILpEjH&2NrcHGcM-`#EE}Sld8c_gBNQn0j#U?U1qh-+!U@ zT{PQEFOSVWA6uO37T4Ait>Pa`t_t|AA<5Cyad&w4Z-XVjBbESf6fTyI!NtcA%P@!~dX=81)%wE{U5ZGm zicjWhlX$`u5guYWz<6uNsKsp}ZFnd6$IG;kasq@PxU$c(+($-<#gKTkK2iXyWg?AS z06#OA=8OR#`v1D#=^s`$`||%$U2k*U@1P_lJM#)EkKOjY5PVNGo_Id(WpiBxq%|L( znHf_&>)f_)LUwn1Zm!e+KuIR=lokc?unAKB{@BbzIUC=oB+jD?gteKTeFbNaD|+54 zE4Eb<_Xx~1;zAwKd6MVT2()OwjgoATq*lptd+D3wcGYFCtl#=(RSuqtsCCSv3q8JQ zXm=FBK@^|JMmUSrI%~jMR=>AW<-Y}%Z&c;K8cWxXSXxwh*na@6 CXuMni delta 1233 zcmcK1TTIhu7{~Gd^HL~vPTpD$MUkXiJ-{STT!3g&FrgzZh8B=jKsIfJwHzuv(3KjP zX3nspllqEJk#W$?iQtO(AO6keA=E=;Y*Dw11GjKBoD)v^g^h4Z z1;EwU=AT8Zs(KNlRUz!*iA;RD0{y26%XMvG9VbO>wDU(ogU~Vno%3lv$m$ZZx*%<# zQuN#)aPQ1?BS1G(G{g&@m9SYXwB3hjB53{aWhnJ-87yDE{yve-ys{z9sCDA4DAGeW z7T-&FHMdm~tR7S4_-sw+SxX8IZzOu!w}0*zZYD3VC;zo`Tz_mQ>Y|ArN9N#7db=CH zFSGU+B{xhcS!Glh!fz1ElDc0KD!zkOppI~5yIItvnQY NhQYbduqgnVzX3Z!_J05X diff --git a/.gradle/5.2.1/executionHistory/executionHistory.lock b/.gradle/5.2.1/executionHistory/executionHistory.lock index 1fe636bb280582c4b6d5b89dddd2357ed5206149..610b8ca5bedd5bde36cfb9f01d44879057295ded 100644 GIT binary patch literal 38 pcmZP;w5{*+H{lmyfPh=f3=B>7W*(V>68h7>GO(DMnprR~004--2TA|{ literal 17 TcmZP;w5{*+H{lmyfPmQm8sq|? diff --git a/.gradle/5.2.1/fileContent/fileContent.lock b/.gradle/5.2.1/fileContent/fileContent.lock index f7d0257026f0f8b86eae7e58ba2f807eae1ecf30..1017ee190df4a6ecb0c18dd978528cc94f6a63b6 100644 GIT binary patch literal 38 ocmZRUi)d`=voW5=00qnp3{Cbox9N6%p3$z)z+!4@X2HM!0I~ZCH~;_u literal 17 ScmZRUi)d`=voW5=00jUgjsp?^ diff --git a/.gradle/5.2.1/fileHashes/fileHashes.bin b/.gradle/5.2.1/fileHashes/fileHashes.bin index de756deb5fe644bdd9ae123bbfc6046ec14a6ad1..752509c4b4b9dc886d1bb2694c58b7e611229212 100644 GIT binary patch delta 1131 zcmZ3unDPHo#tkMClI9aUO=7RrPru3l27#CVL&0QIi3)+OcebB4E#|L+NCusqyj0?c zz~?1W+b;iBJpmPD-8@xNfKfoT(KMcY|I>+3(agznr2;gZjSIY4nvEtv1Opes4EI?7 zVOfdNn`Efs*^{42We7wGRowo^S`SqmWWL!|x{8sB)pDca5Alr#4}>;5dW5hlEazoD z9?@mjFsr2~>u%ejG zHi#nTGm|C#BAHVz1x}Xrk(%7^CkkZ8PG0V(U!QWx6rzU38A$6H0|`waRs>-IF8S`| z52oG@e5~~0ldql0Du~sWT!E56z!?lA&~!w)96gnKbCIh;%Y9bEL+kaSIs(BO7})L5 zb%ZDiq+F^xp{!79ExJ_AQ=8L!F<48gf{`bxOz4MazP7*J(B5Hp2f zYALtj6~7d3zxk!R?aEnaPrd?cNx5VTR0#wuKY#>Uh%GL9yVUIRMb7&lMdf~Zu^vIw zaSKyN{lE7G^*g13wnWy)FtYBbZmH`rImgs+ba{h6*0Vf zSM@-2oSgyIz`zDdlfGMnz3;d&ry(&70_z&hYj&u;z=Q;ThAaY=>#$ySN_ RC*QfJoS1{Eh4B@p1j;o-&V&=7^0TN8A$6H0|`waRs>-I_aA)cTm%D8y{SIFw14Ld zRj}zgX7WHuAmC)2EbpsUF9b9eBESmLiDty}Xtfj1%(F6$X679^BPY`hb>MD@4!#AL zI_9f3&Pux`y>i#fgM!UJgUg_n0(F7_p9GLVwxb^CPM_F!y2?RwIa%!<83wK^o(j=o zQ4ZF@z~G9e1*l_2%;{`Z$B#_Hf0R5eGW;vhbhKgW*xLL53B#Y@=PjYyI~Weit$^t; zf>^?0hpFXZUYE;EnZK+TD)v+d^ecwLv`o$n&}Y`MXr8>^OG+Xk$|$$*kKo%sT{BFU zPng^YRn$EBEL72dC~X)h6;>vqA||Ez*|k%{N;o`h9WX3_(G4^S;s#!COgEH^X1AIj XDtr{WcVo}3;-ptFH$Zf-frADB2d17j diff --git a/.gradle/5.2.1/fileHashes/fileHashes.lock b/.gradle/5.2.1/fileHashes/fileHashes.lock index 9388d5c1957e2631fffa5d5e58152c07b50e58b9..076b6cfb52bd9819ce29629a893d5aba6a8cd4a8 100644 GIT binary patch literal 38 qcmZRs2+M!|?$oEr3}C<{#mvCaWdEJh?RaqtzXbz}si~O-0|Nl?TnbD8 literal 17 VcmZRs2+M!|?$oEr3}C=G82~}01^EB~ diff --git a/.gradle/5.2.1/fileHashes/resourceHashesCache.bin b/.gradle/5.2.1/fileHashes/resourceHashesCache.bin index bce298e51646b45467b4fae49a0e27765310302d..69e9c4639714f2701c048ce8453006134bddeb61 100644 GIT binary patch delta 363 zcmX>;m2vWP#tkMCjFOX0B@zVY{dydDdHLm)3}E1Od~&ZufWW~QmyPyS{Dlg77f!w^ zp&)P}rEzQN#&cZ|mEO9O-vU+sU*&bb(IQX{s{Q3;Q^^?u#tZJ9{S+c`8LHBM@=-|z zfvnqle=Z$1y$%)Ro_tqQi-{?7qv8+ojRqS;H#>T?G1VIbWhH@F5QGJ6!)-EI@784h z;ePu@UP)y;P*4t4Mfa*L>8tOb*<+fs)}+(^zza+jKNU|&YcqeEJ9Gc*(<}ET`D3a; vGQ$^#A0kAX}0TYuo7+{mF7)X;185om28Ay|z8IY4j8W@vx8X^J#*|8z` N7qKuv7PCP}h5`gu5?TNN diff --git a/.gradle/5.2.1/javaCompile/classAnalysis.bin b/.gradle/5.2.1/javaCompile/classAnalysis.bin index d91bf505fa6ed83b4122a0875f59c68ff625aac9..5527d9a057b66b9ec63ec33861900307ada59962 100644 GIT binary patch delta 1252 zcmeyjj`8II#tkMCjB1ljB@6^QY)>c^6nZK!fI-Be$*~d*0y|rmar|7&Iv*k!)javC zM25rl%KI(*mma?eRcZGh3LadW|E-BbK@uV!9|jYDqy6{6*Jo2LAmXuNlT9TX1aykN z?TPkVa2X;Pqd$4A3aOM#UfE8x1N%HamLQ^79!3Ww!(IdJx_< zSCOOqW#1j4{*1Y5@yl3H8>au6Hb zN?CkXrb6ARJ$XZr0x|Y7@`LPE0b&^t2HLC7#Eu+T;PgY3Nt(3ufi#-0L16*`jQjxf C?}jP> delta 55 zcmV-70LcI8zybcQ0kAX}0UVPx7%-E47pDbSRiBXj)?{qE7BS=)i2*mlX?u)$-Z{-LJx__ zcl}fucY#<&&WTCEsYPX($*Hat$*Bb;nfZAta8^iVL8`!$hNHZy6{}dQOg&d#irS|! z+0jpWvaJ7Z#x)=VG_V*T(8$X%<7z?pBvITWi> zqhpyEL6Dh=iIJUwb3NFSyM7{qAPGhmpad%u6Eh0~*L;}u7C;%G2pdp}9jKFmp#d1= zD?#DE9Ej(Gut2}5)s3DlGTgJ%AKm$Wt8*uL;a_gUD}E{7e)CIr+m*A$5B@!kdl?Z0sxl!?l_(p>S@y(7NmpK6B+zjgg diff --git a/.gradle/5.2.1/javaCompile/javaCompile.lock b/.gradle/5.2.1/javaCompile/javaCompile.lock index 2bef620a9890bd765bad4569cb4875fdd1966a7a..e47d4ee3c7bb09f8594e292464ddd34936fa2cc0 100644 GIT binary patch literal 38 pcmZSHXmLQ5@z|MO1_)Tg%)roO@A*c-e2xUea|RYuQ!@(&1^~+S31t8P literal 17 UcmZSHXmLQ5@z|MO1_)>e05Jaqc>n+a diff --git a/.gradle/5.2.1/javaCompile/taskHistory.bin b/.gradle/5.2.1/javaCompile/taskHistory.bin index 8a6f5b571e87efc2ee17283a74bebca532fc2088..659bc2cee4f92d0f55c7347f6b362d8792eb5f3d 100644 GIT binary patch delta 31 ncmZ2Bm2ufr#tlB60{x~|H+r_naL-PEbm#l6&YhcMJiQnJ-yaTv delta 31 pcmV+)0O0?ol>w%e0kBL-5K7px^9En9+9_qj*F~B^k+WP$N&)014gUZD diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 84b08c09bef5e51271f97f4dba36a790327beb5f..33c7d15efb0815b0d6b265b3d2cfd405ec651db2 100644 GIT binary patch literal 38 qcmZQpD6R5Sla - - - + + + + + + + + + + + + + + + + + + + + - + - + @@ -124,12 +141,12 @@ false - + @@ -144,12 +161,12 @@ false - + @@ -166,11 +183,11 @@ + + + - - - @@ -210,16 +227,18 @@ file://$PROJECT_DIR$/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java - 36 - - + + file://$PROJECT_DIR$/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java + 39 + + file://$PROJECT_DIR$/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java - 45 - - - diff --git a/build/classes/java/main/com/cabinvoicegenerator/CabServiceException$ExceptionType.class b/build/classes/java/main/com/cabinvoicegenerator/CabServiceException$ExceptionType.class new file mode 100644 index 0000000000000000000000000000000000000000..8593ea3e6399b089416b7608995d09712b807517 GIT binary patch literal 1272 zcmbtTU2hUW6g>kA3)`h1v?|4_t)lW#p;de^5Q1rGf>|Mvwn^gy8P*lIS$3OcA^NYB zCe~;)efCEg?`%m+V_z(@$=;c{XYM)o&Yjs{4d?sR*7-rwpw`=W2bGN?bTWg z<+oEs4iC9C5CSXd%yf~YE$1EOJ*Szr(HQhPhP%r<7VXGBMe{vFGp!x+Aum|m?iN~} zYuepXW-9q{&C$8F&s|e+jR_^2_lP(CFBwC)Y}%$*VYqpPmU?ENLG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ai|TA!HdD03rP5|Gx)MO zr~nlM0h@yegu%t&$KVfA6Ts%62N7a(Fo7^Q83GxCKtwPX(4-J{hEOgBF@`XZ1>qnf zf{THTgCUZgA!=hQKl9`z%$1DMljT@Uxnp=3Vi~k}7~&Y>C&#g9^Cj>wBr+uNFeEc* zu`{Ghp3Y*!oyx;t$6(LHkj9Wc`5ucDJF|vn7$bwuWJMN<$>$kGHb=5*F*7nwZs7=K ZXJl|R{&DCCrpp-<k?+oj5!IzcHA%zZ%Vi&VSY35p80!n zO?Ca%l3L5FYZZ+_PQG2&YRz(0Zx}z=bNc{%9B1G);zG=Oo8t}^I0lfAkmOjzU52RP zX8m&u>RL{#x612UM}WaysJ>BNs4Y#=t4h86Oj9J><9L9ysjj!a;RtyU13h>i>gMJ8+#%Syafzi(pqI<9vVqb7-2huL=A|8K$ zYY&csN8UpB4*0<)rHlAu=OQ~dHiG0fN`$7L($+-VkJNDi7cGV;hA>RtAE_Qt%Vz lphe_ut96JX$3!Lvbu#c5hCtUaTO7rG8fC(oBDmCi|8E-MqapwR delta 399 zcmX|*OHKko6h%*Urzt2(`~cl3D4^IV;2-}wbLa+092s4QZo%{_oJnGgnn)NsatE%% ziSczeaZvBws=DvoH!3`ui_hQp5zyz{P@t7#id9W$aA|4UhBej=9-Ta0dU4s%Y{oBJ zn!09NvopN9SJ98U$rdSDrkROuonCdiQOIePU%KFMF2lSvrmB*Sl{L;oR_Nr+-O8CdxP>pdq) diff --git a/build/classes/java/test/com/cabinvoicegenerator/InvoiceServiceTest.class b/build/classes/java/test/com/cabinvoicegenerator/InvoiceServiceTest.class index 4246bce860e301e2d9bf332e7e9350f0ce6e73f6..24c3d7b5fef09a07768f79ca58302314eb20dc6c 100644 GIT binary patch delta 540 zcmX|;OHWim5QV?Kb02eiT8%_-h75_%0fCGO!93uGZ`Lc&sigE9URW8EOs;&h*?Q+2A-Z?nI%FMt01whpxNLUV||fb$_2 zxTtaH_amvq5wlBv)V9S2DEQr9-^H=)M|(EY0fU-dT#m(80CXSeQID3+#X%azHQfKf%O-KX}h77{s?9y1gf zHyoy9xX(nu14EgIcF{c;K8jP16*;@)rfuF!+I7dbe_XfaNi3RF1f$VdzE}}jVao87 z>3|u-EOP<#hG#4oo-?j!{6C^zHQ5a>TUDB#FBePOdnuYF-MsqB`{1gCZP35Mlk#2{ z#VOlwGIk?XV_Q571}vEOoY%WprOmK z?2RflbsJV=e(FK5(e!Yx>cX&!er=9E0T22WJisw%SiwABh#`R<3_CHRwxdeMOpGHe z1R|JFFDFlr%k?Nn?EdydV*#pQC7F1EpOsEY#F3DwMp7b$X^t6*SzD%LpGB{s0hu_dvM9f@5e7;67c)MUu< ztTT;f#j7V^M=-$9V0VV*wDi%w>xi|a#h4RqpX9S?LoWJpg*SBBFJ$!u<& zL7Vp+!O&$%SFA*hs_@r%wN5)dmS^+&I`^gWTbo+AB?E?nWqXaH&8yPg^`tFo!WBLb zJ-@gr9kD8Qyg-t-wS*J*#W7fnx7ECN+iDBTZ)RWXmkB@zO zT-_FSNNvk5l+`3>xZ|i4Qf)MQvcKmvHLg$-VXMN(DHU?(lpu5;n^g*E)Cir)34BW)6_}u3$# - - - - -Test results - Class com.cabinvoicegenerator.InvoiceServiceTest - - - - - -
-

Class com.cabinvoicegenerator.InvoiceServiceTest

- -
- - - - - -
-
- - - - - - - -
-
-
8
-

tests

-
-
-
-
0
-

failures

-
-
-
-
0
-

ignored

-
-
-
-
0.011s
-

duration

-
-
-
-
-
-
100%
-

successful

-
-
-
-
- -
-

Tests

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TestDurationResult
givenDistanceAndTimeForNormal_ShouldReturnTotalFare0.001spassed
givenDistanceAndTimeForPremium_ShouldReturnTotalFare0spassed
givenLessDistanceAndTimeForNormal_ShouldReturnMinimumFare0spassed
givenLessDistanceAndTimeForPremium_ShouldReturnMinimumFare0spassed
givenMultipleRidesForNormal_ShouldReturnInvoiceSummary0.002spassed
givenMultipleRidesForPremium_ShouldReturnInvoiceSummary0.001spassed
givenUserIdAndRidesForNormal_ShouldReturnInvoiceSummary0.001spassed
givenUserIdAndRidesForPremium_ShouldReturnInvoiceSummary0.006spassed
-
-
-

Standard output

- -
InvoiceSummary{numOfRides=2, totalFare=60.0, averageFare=30.0}
-InvoiceSummary{numOfRides=2, totalFare=30.0, averageFare=15.0}
-
-
-
-
- -
- - diff --git a/build/reports/tests/test/css/base-style.css b/build/reports/tests/test/css/base-style.css deleted file mode 100644 index 4afa73e..0000000 --- a/build/reports/tests/test/css/base-style.css +++ /dev/null @@ -1,179 +0,0 @@ - -body { - margin: 0; - padding: 0; - font-family: sans-serif; - font-size: 12pt; -} - -body, a, a:visited { - color: #303030; -} - -#content { - padding-left: 50px; - padding-right: 50px; - padding-top: 30px; - padding-bottom: 30px; -} - -#content h1 { - font-size: 160%; - margin-bottom: 10px; -} - -#footer { - margin-top: 100px; - font-size: 80%; - white-space: nowrap; -} - -#footer, #footer a { - color: #a0a0a0; -} - -#line-wrapping-toggle { - vertical-align: middle; -} - -#label-for-line-wrapping-toggle { - vertical-align: middle; -} - -ul { - margin-left: 0; -} - -h1, h2, h3 { - white-space: nowrap; -} - -h2 { - font-size: 120%; -} - -ul.tabLinks { - padding-left: 0; - padding-top: 10px; - padding-bottom: 10px; - overflow: auto; - min-width: 800px; - width: auto !important; - width: 800px; -} - -ul.tabLinks li { - float: left; - height: 100%; - list-style: none; - padding-left: 10px; - padding-right: 10px; - padding-top: 5px; - padding-bottom: 5px; - margin-bottom: 0; - -moz-border-radius: 7px; - border-radius: 7px; - margin-right: 25px; - border: solid 1px #d4d4d4; - background-color: #f0f0f0; -} - -ul.tabLinks li:hover { - background-color: #fafafa; -} - -ul.tabLinks li.selected { - background-color: #c5f0f5; - border-color: #c5f0f5; -} - -ul.tabLinks a { - font-size: 120%; - display: block; - outline: none; - text-decoration: none; - margin: 0; - padding: 0; -} - -ul.tabLinks li h2 { - margin: 0; - padding: 0; -} - -div.tab { -} - -div.selected { - display: block; -} - -div.deselected { - display: none; -} - -div.tab table { - min-width: 350px; - width: auto !important; - width: 350px; - border-collapse: collapse; -} - -div.tab th, div.tab table { - border-bottom: solid #d0d0d0 1px; -} - -div.tab th { - text-align: left; - white-space: nowrap; - padding-left: 6em; -} - -div.tab th:first-child { - padding-left: 0; -} - -div.tab td { - white-space: nowrap; - padding-left: 6em; - padding-top: 5px; - padding-bottom: 5px; -} - -div.tab td:first-child { - padding-left: 0; -} - -div.tab td.numeric, div.tab th.numeric { - text-align: right; -} - -span.code { - display: inline-block; - margin-top: 0em; - margin-bottom: 1em; -} - -span.code pre { - font-size: 11pt; - padding-top: 10px; - padding-bottom: 10px; - padding-left: 10px; - padding-right: 10px; - margin: 0; - background-color: #f7f7f7; - border: solid 1px #d0d0d0; - min-width: 700px; - width: auto !important; - width: 700px; -} - -span.wrapped pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: break-all; -} - -label.hidden { - display: none; -} \ No newline at end of file diff --git a/build/reports/tests/test/css/style.css b/build/reports/tests/test/css/style.css deleted file mode 100644 index 3dc4913..0000000 --- a/build/reports/tests/test/css/style.css +++ /dev/null @@ -1,84 +0,0 @@ - -#summary { - margin-top: 30px; - margin-bottom: 40px; -} - -#summary table { - border-collapse: collapse; -} - -#summary td { - vertical-align: top; -} - -.breadcrumbs, .breadcrumbs a { - color: #606060; -} - -.infoBox { - width: 110px; - padding-top: 15px; - padding-bottom: 15px; - text-align: center; -} - -.infoBox p { - margin: 0; -} - -.counter, .percent { - font-size: 120%; - font-weight: bold; - margin-bottom: 8px; -} - -#duration { - width: 125px; -} - -#successRate, .summaryGroup { - border: solid 2px #d0d0d0; - -moz-border-radius: 10px; - border-radius: 10px; -} - -#successRate { - width: 140px; - margin-left: 35px; -} - -#successRate .percent { - font-size: 180%; -} - -.success, .success a { - color: #008000; -} - -div.success, #successRate.success { - background-color: #bbd9bb; - border-color: #008000; -} - -.failures, .failures a { - color: #b60808; -} - -.skipped, .skipped a { - color: #c09853; -} - -div.failures, #successRate.failures { - background-color: #ecdada; - border-color: #b60808; -} - -ul.linkList { - padding-left: 0; -} - -ul.linkList li { - list-style: none; - margin-bottom: 5px; -} diff --git a/build/reports/tests/test/index.html b/build/reports/tests/test/index.html deleted file mode 100644 index 1ff9a7b..0000000 --- a/build/reports/tests/test/index.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - -Test results - Test Summary - - - - - -
-

Test Summary

-
- - - - - -
-
- - - - - - - -
-
-
8
-

tests

-
-
-
-
0
-

failures

-
-
-
-
0
-

ignored

-
-
-
-
0.011s
-

duration

-
-
-
-
-
-
100%
-

successful

-
-
-
-
- -
-

Packages

- - - - - - - - - - - - - - - - - - - - - -
PackageTestsFailuresIgnoredDurationSuccess rate
-com.cabinvoicegenerator -8000.011s100%
-
-
-

Classes

- - - - - - - - - - - - - - - - - - - - - -
ClassTestsFailuresIgnoredDurationSuccess rate
-com.cabinvoicegenerator.InvoiceServiceTest -8000.011s100%
-
-
- -
- - diff --git a/build/reports/tests/test/js/report.js b/build/reports/tests/test/js/report.js deleted file mode 100644 index 83bab4a..0000000 --- a/build/reports/tests/test/js/report.js +++ /dev/null @@ -1,194 +0,0 @@ -(function (window, document) { - "use strict"; - - var tabs = {}; - - function changeElementClass(element, classValue) { - if (element.getAttribute("className")) { - element.setAttribute("className", classValue); - } else { - element.setAttribute("class", classValue); - } - } - - function getClassAttribute(element) { - if (element.getAttribute("className")) { - return element.getAttribute("className"); - } else { - return element.getAttribute("class"); - } - } - - function addClass(element, classValue) { - changeElementClass(element, getClassAttribute(element) + " " + classValue); - } - - function removeClass(element, classValue) { - changeElementClass(element, getClassAttribute(element).replace(classValue, "")); - } - - function initTabs() { - var container = document.getElementById("tabs"); - - tabs.tabs = findTabs(container); - tabs.titles = findTitles(tabs.tabs); - tabs.headers = findHeaders(container); - tabs.select = select; - tabs.deselectAll = deselectAll; - tabs.select(0); - - return true; - } - - function getCheckBox() { - return document.getElementById("line-wrapping-toggle"); - } - - function getLabelForCheckBox() { - return document.getElementById("label-for-line-wrapping-toggle"); - } - - function findCodeBlocks() { - var spans = document.getElementById("tabs").getElementsByTagName("span"); - var codeBlocks = []; - for (var i = 0; i < spans.length; ++i) { - if (spans[i].className.indexOf("code") >= 0) { - codeBlocks.push(spans[i]); - } - } - return codeBlocks; - } - - function forAllCodeBlocks(operation) { - var codeBlocks = findCodeBlocks(); - - for (var i = 0; i < codeBlocks.length; ++i) { - operation(codeBlocks[i], "wrapped"); - } - } - - function toggleLineWrapping() { - var checkBox = getCheckBox(); - - if (checkBox.checked) { - forAllCodeBlocks(addClass); - } else { - forAllCodeBlocks(removeClass); - } - } - - function initControls() { - if (findCodeBlocks().length > 0) { - var checkBox = getCheckBox(); - var label = getLabelForCheckBox(); - - checkBox.onclick = toggleLineWrapping; - checkBox.checked = false; - - removeClass(label, "hidden"); - } - } - - function switchTab() { - var id = this.id.substr(1); - - for (var i = 0; i < tabs.tabs.length; i++) { - if (tabs.tabs[i].id === id) { - tabs.select(i); - break; - } - } - - return false; - } - - function select(i) { - this.deselectAll(); - - changeElementClass(this.tabs[i], "tab selected"); - changeElementClass(this.headers[i], "selected"); - - while (this.headers[i].firstChild) { - this.headers[i].removeChild(this.headers[i].firstChild); - } - - var h2 = document.createElement("H2"); - - h2.appendChild(document.createTextNode(this.titles[i])); - this.headers[i].appendChild(h2); - } - - function deselectAll() { - for (var i = 0; i < this.tabs.length; i++) { - changeElementClass(this.tabs[i], "tab deselected"); - changeElementClass(this.headers[i], "deselected"); - - while (this.headers[i].firstChild) { - this.headers[i].removeChild(this.headers[i].firstChild); - } - - var a = document.createElement("A"); - - a.setAttribute("id", "ltab" + i); - a.setAttribute("href", "#tab" + i); - a.onclick = switchTab; - a.appendChild(document.createTextNode(this.titles[i])); - - this.headers[i].appendChild(a); - } - } - - function findTabs(container) { - return findChildElements(container, "DIV", "tab"); - } - - function findHeaders(container) { - var owner = findChildElements(container, "UL", "tabLinks"); - return findChildElements(owner[0], "LI", null); - } - - function findTitles(tabs) { - var titles = []; - - for (var i = 0; i < tabs.length; i++) { - var tab = tabs[i]; - var header = findChildElements(tab, "H2", null)[0]; - - header.parentNode.removeChild(header); - - if (header.innerText) { - titles.push(header.innerText); - } else { - titles.push(header.textContent); - } - } - - return titles; - } - - function findChildElements(container, name, targetClass) { - var elements = []; - var children = container.childNodes; - - for (var i = 0; i < children.length; i++) { - var child = children.item(i); - - if (child.nodeType === 1 && child.nodeName === name) { - if (targetClass && child.className.indexOf(targetClass) < 0) { - continue; - } - - elements.push(child); - } - } - - return elements; - } - - // Entry point. - - window.onload = function() { - initTabs(); - initControls(); - }; -} (window, window.document)); \ No newline at end of file diff --git a/build/reports/tests/test/packages/com.cabinvoicegenerator.html b/build/reports/tests/test/packages/com.cabinvoicegenerator.html deleted file mode 100644 index 5cab5d3..0000000 --- a/build/reports/tests/test/packages/com.cabinvoicegenerator.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - -Test results - Package com.cabinvoicegenerator - - - - - -
-

Package com.cabinvoicegenerator

- -
- - - - - -
-
- - - - - - - -
-
-
8
-

tests

-
-
-
-
0
-

failures

-
-
-
-
0
-

ignored

-
-
-
-
0.011s
-

duration

-
-
-
-
-
-
100%
-

successful

-
-
-
-
- -
-

Classes

- - - - - - - - - - - - - - - - - - - -
ClassTestsFailuresIgnoredDurationSuccess rate
-InvoiceServiceTest -8000.011s100%
-
-
- -
- - diff --git a/build/test-results/test/TEST-com.cabinvoicegenerator.InvoiceServiceTest.xml b/build/test-results/test/TEST-com.cabinvoicegenerator.InvoiceServiceTest.xml deleted file mode 100644 index 1897185..0000000 --- a/build/test-results/test/TEST-com.cabinvoicegenerator.InvoiceServiceTest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - diff --git a/build/test-results/test/binary/output.bin b/build/test-results/test/binary/output.bin index 3a1fafe..e69de29 100644 --- a/build/test-results/test/binary/output.bin +++ b/build/test-results/test/binary/output.bin @@ -1,2 +0,0 @@ -?InvoiceSummary{numOfRides=2, totalFare=60.0, averageFare=30.0} - ?InvoiceSummary{numOfRides=2, totalFare=30.0, averageFare=15.0} diff --git a/build/test-results/test/binary/output.bin.idx b/build/test-results/test/binary/output.bin.idx deleted file mode 100644 index b8599ea55d833836a590e287f66da048fd169809..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 69 ZcmZQ%Vq#@L1OL$gCsf`UMx)992LLPp_NGH}f2g{lis&MDOh%9FLQS71gK~uCjDp zVM-;Mspd1yQdF1Om3CE`qIIk`JSU~#o5&apTJi}D?>+g5j1{WDLsjM^v0Ev76|A>apQ`mX*FZlS!e%6o8h3+#LKYwH2v-5ZI@yXzx!S34O)9!oF L-POnDf_o0Hc0HK+ diff --git a/src/main/java/com/cabinvoicegenerator/CabServiceException.java b/src/main/java/com/cabinvoicegenerator/CabServiceException.java new file mode 100644 index 0000000..dabe0b8 --- /dev/null +++ b/src/main/java/com/cabinvoicegenerator/CabServiceException.java @@ -0,0 +1,25 @@ +package com.cabinvoicegenerator; + +public class CabServiceException extends Exception { + + enum ExceptionType { + NULL_ID, RIDE_NOT_FOUND + } + + ExceptionType type; + + public CabServiceException(String message, String name) { + super(message); + this.type = ExceptionType.valueOf(name); + } + + public CabServiceException(String message, ExceptionType type) { + super(message); + this.type = type; + } + + public CabServiceException(String message, ExceptionType type, Throwable cause) { + super(message, cause); + this.type = type; + } +} diff --git a/src/main/java/com/cabinvoicegenerator/InVoiceService.java b/src/main/java/com/cabinvoicegenerator/InVoiceService.java index dde94c3..ffbfc0b 100644 --- a/src/main/java/com/cabinvoicegenerator/InVoiceService.java +++ b/src/main/java/com/cabinvoicegenerator/InVoiceService.java @@ -35,11 +35,11 @@ public InvoiceSummary calculateTotalFare(Ride[] rides) { return new InvoiceSummary(rides.length, totalFare); } - public void addRides(String userId, Ride[] rides) { + public void addRides(String userId, Ride[] rides) throws CabServiceException { rideRepository.addRides(userId, rides); } - public InvoiceSummary getInvoiceSummmary(String userId) { + public InvoiceSummary getInvoiceSummmary(String userId) throws CabServiceException { Ride[] rides = rideRepository.getRides(userId); return this.calculateTotalFare(rides); } diff --git a/src/main/java/com/cabinvoicegenerator/RideRepository.java b/src/main/java/com/cabinvoicegenerator/RideRepository.java index 215e712..3118bd1 100644 --- a/src/main/java/com/cabinvoicegenerator/RideRepository.java +++ b/src/main/java/com/cabinvoicegenerator/RideRepository.java @@ -11,14 +11,24 @@ public RideRepository() { this.userRides = new HashMap<>(); } - public void addRides(String userId,Ride[] rides) - { - this.userRides.put(userId,new ArrayList(Arrays.asList(rides))); - } - - public Ride[] getRides(String userId) - { - return this.userRides.get(userId).toArray(new Ride[0]); + public void addRides(String userId,Ride[] rides) throws CabServiceException{ + + if (rides != null) { + this.userRides.put(userId, new ArrayList(Arrays.asList(rides))); + } + else{ + throw new CabServiceException("You have no ride ",CabServiceException.ExceptionType.RIDE_NOT_FOUND); + } + } + + public Ride[] getRides(String userId) throws CabServiceException { + + if (userId != null) { + return this.userRides.get(userId).toArray(new Ride[0]); + } + else { + throw new CabServiceException("You have problem in ID", CabServiceException.ExceptionType.NULL_ID); + } } } diff --git a/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java b/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java index b2df1d2..a8e12d5 100644 --- a/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java +++ b/src/test/java/com/cabinvoicegenerator/InvoiceServiceTest.java @@ -36,7 +36,7 @@ public void givenMultipleRidesForNormal_ShouldReturnInvoiceSummary() { } @Test - public void givenUserIdAndRidesForNormal_ShouldReturnInvoiceSummary() { + public void givenUserIdAndRidesForNormal_ShouldReturnInvoiceSummary() throws CabServiceException { InVoiceService inVoiceService = new InVoiceService(CabSubscriptionsType.NORMAL); String userId = "a@b.com"; Ride[] rides = {new Ride(2.0, 5), @@ -80,7 +80,7 @@ public void givenMultipleRidesForPremium_ShouldReturnInvoiceSummary() { } @Test - public void givenUserIdAndRidesForPremium_ShouldReturnInvoiceSummary() { + public void givenUserIdAndRidesForPremium_ShouldReturnInvoiceSummary() throws CabServiceException { InVoiceService inVoiceService = new InVoiceService(CabSubscriptionsType.PREMIUM); String userId = "a@b.com"; Ride[] rides = {new Ride(2.0, 5), @@ -89,7 +89,6 @@ public void givenUserIdAndRidesForPremium_ShouldReturnInvoiceSummary() { inVoiceService.addRides(userId, rides); InvoiceSummary summary = inVoiceService.getInvoiceSummmary(userId); InvoiceSummary expectedInvoiceSummary = new InvoiceSummary(2, 60.0); - System.out.println(expectedInvoiceSummary); Assert.assertEquals(expectedInvoiceSummary, summary); } } diff --git a/src/test/java/com/cabinvoicegenerator/RideRepositoryTest.java b/src/test/java/com/cabinvoicegenerator/RideRepositoryTest.java new file mode 100644 index 0000000..d80f144 --- /dev/null +++ b/src/test/java/com/cabinvoicegenerator/RideRepositoryTest.java @@ -0,0 +1,24 @@ +package com.cabinvoicegenerator; + +import org.junit.Assert; +import org.junit.Test; + +public class RideRepositoryTest { + + @Test + public void givenMessage_RidesAddedByParticularUserId_ShouldReturnSummaryForThatUserId() { + try { + RideRepository rideRepository = new RideRepository(); + String userId = "a@b.com"; + Ride[] rides = {new Ride(2.0, 5), + new Ride(0.1, 1) + }; + rideRepository.addRides(userId, rides); + Ride[] summary = new Ride[0]; + summary = rideRepository.getRides(userId); + Assert.assertEquals(rides[0], summary[0]); + } catch (CabServiceException e) { + Assert.assertEquals(CabServiceException.ExceptionType.NULL_ID, e.getMessage()); + } + } +}