Commit 75352fa5 authored by adnansetiawan's avatar adnansetiawan

add unit testing for zona

parent c42016bf
Pipeline #24595 passed with stages
in 7 minutes and 14 seconds
......@@ -99,10 +99,11 @@
<Property Name="sonar.java.collectAnalysisErrors">false</Property>
<Property Name="sonar.updatecenter.url">https://update.sonarsource.org/update-center.properties</Property>
<Property Name="sonar.core.id">BF41A1F2-AXE_vdHPrJB8apnk_sSE</Property>
<Property Name="sonar.core.startTime">04/12/2020 09:29:47</Property>
<Property Name="sonar.core.startTime">04/12/2020 10:24:40</Property>
</ServerSettings>
<LocalSettings>
<Property Name="sonar.cs.opencover.reportsPaths">EasyParking.UnitTest/coverage.opencover.xml</Property>
<Property Name="sonar.coverage.exclusions">**Test*.cs</Property>
</LocalSettings>
<AnalyzersSettings>
<AnalyzerSettings>
......
projectKey=easyparking
serverUrl=http://localhost:9000
serverVersion=8.2.0.32929
dashboardUrl=http://localhost:9000/dashboard?id=easyparking
ceTaskId=AXFslmgWUgKXJsyHcafh
ceTaskUrl=http://localhost:9000/api/ce/task?id=AXFslmgWUgKXJsyHcafh
......@@ -34,12 +34,12 @@ p/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
w/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Location/LocationService.cs 8 r4
 !"#$%&'()*+,-./0123456x !%)*+,0123
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/IParkingRepository.csr 

u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingService.cs 8
r2
 !"#$%&'()*+,-./0345x!%)*+,-./0
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingTransaction.cs 8r
x

u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingService.cs 8
r3
 !"#$%&'()*+,-./02345x!%)*+,-./02
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingTransaction.cs 8r&
 !"#$&(x !
s/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Rate/IRateRepository.csr 

h/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Rate/Rate.cs 8r
......@@ -69,6 +69,6 @@ x/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
s/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/IZonaRepository.csr

h/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/Zona.cs 8 r 

o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/ZonaService.cs 8 r3
 !"#$%&'()*+,-./0123456x #'+/3
\ No newline at end of file

o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/ZonaService.cs 8r9
 !"#$%&'()*+,-./012345789:;<=x #'+,-.2345:
\ No newline at end of file
......
......@@ -335,8 +335,8 @@ p/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
 %
w/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Location/LocationService.cs
 Z
- @    # 6 !! %% &)) ,00 ,
 n
- @   ) < # 6) < !! %% &)) ,00 ,


......@@ -346,12 +346,11 @@ w/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
3 E  " 4
 
$ ,3 ;' /
 & &
.. !) 2) 2
$ ,G O' /
 & &
 2
$ ,? G3 ;O W' /
$ ,? GG OO W' /
  
 & &2 H
......@@ -362,7 +361,9 @@ w/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
'' 
''% '))5 7
)) ** ,, 
)) ** ,, 
.. !
..) -007 ;
00 11 33 
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/IParkingRepository.cs
......@@ -393,11 +394,11 @@ y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
   2
  : F
  : F
u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingService.cs
 F
, >  !! %%% %,, 2// 2
 P
, >  !! %%% %,, 2// 22 %2
  ) 8  & 00 (


......@@ -420,30 +421,30 @@ u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
##" 9
##A M%%> J
'' 
''' 3,,K W
'': C))3 <
)) ** (
,, -- //+ 800) 6
''" -
''5 A,,K W
''H Q))3 <
)) ** 2
,, -- //+ 800) 622. ;
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingTransaction.cs
 #
 
 
 (
  !! !!A E
 "
   !4 =/ 8(


 !   
   
 !   
   !!/ 7
 
 
 
$$ 
s/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Rate/IRateRepository.cs
 $
......@@ -846,11 +847,11 @@ h/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy

 %
   
   
o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/ZonaService.cs
 Z
) 8     ## '' "++ "// "33 "
) 8     ## '' "++ (22 (:: "


......@@ -862,7 +863,7 @@ o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
 
 $/ 3# '
 " "
-- % .% .
00 % .% .
 <
 $' +/ 3G K # '
......@@ -874,8 +875,10 @@ o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
!! "### %
%%# +
))! #+++ -
--% )//- 1
))! #++1 3
++ ,, .. 
00% )223 7
22 33 55 
11# 0
116 @331 ;
\ No newline at end of file
88# 0
886 @::1 ;
\ No newline at end of file
......
......@@ -1732,7 +1732,7 @@ p/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
;0 1
}2 3
} 
} &
} '
w/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Location/LocationService.cs
namespace 
EasyParking
......@@ -1784,14 +1784,16 @@ w/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
{ 
var "
existingLocationByName &
=' (
GetByName) 2
(2 3
location3 ;
.; <
Name< @
)@ A
;A B
=' (
_locationRepository) <
.< =
GetByName= F
(F G
locationG O
.O P
NameP T
)T U
;U V
if 
( "
existingLocationByName &
......@@ -1856,14 +1858,16 @@ Exceptions )
;D E
var "
existingLocationByName &
=' (
GetByName) 2
(2 3
location3 ;
.; <
Name< @
)@ A
;A B
=' (
_locationRepository) <
.< =
GetByName= F
(F G
locationG O
.O P
NameP T
)T U
;U V
if 
( "
existingLocationByName &
......@@ -2079,7 +2083,7 @@ y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
)  F G
;  G H
}   
} +
} ,
u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingService.cs
namespace 
EasyParking
......@@ -2286,16 +2290,16 @@ Exceptions )
)%%J K
;%%K L
}&& 
public'' 
void'' 
StopParking'' 
('' 
string'' &
licensePlate''' 3
,''3 4
Guid''5 9
inputedBy'': C
)''C D
public'' 
ParkingTransaction'' !
StopParking''" -
(''- .
string''. 4
licensePlate''5 A
,''A B
Guid''C G
inputedBy''H Q
)''Q R
{(( 
var)) 
user)) 
......@@ -2372,10 +2376,20 @@ Exceptions.. )
,00> ?
true00@ D
)00D E
;00E F
;00E F
return22 
_parkingRepository22 %
.22% &
GetById22& -
(22- .
activeParking22. ;
.22; <
Id22< >
)22> ?
;22? @
}33 
}44 
}55 
}55 
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingTransaction.cs
namespace 
EasyParking
......@@ -2503,17 +2517,61 @@ HasStopped 
;( )
} 
} 
public 
User 
InputedBy 
{ 
get #
;# $
set% (
;( )
}* +
} 
} 
public 
decimal 
Total 
{ 
get 
{ 
if 
( 
Slot 
. 
Zona 
. 
Rate "
==# %
null& *
)* +
return   
$num   
;   
return!! 
(!! 
Slot!! 
.!! 
Zona!! !
.!!! "
Rate!!" &
.!!& '
Price!!' ,
*!!- .
Duration!!/ 7
.!!7 8
Hours!!8 =
)!!= >
+!!? @
Slot!!A E
.!!E F
Zona!!F J
.!!J K
Rate!!K O
.!!O P
Price!!P U
;!!U V
}"" 
}## 
public$$ 
User$$ 
InputedBy$$ 
{$$ 
get$$ #
;$$# $
set$$% (
;$$( )
}$$* +
}&& 
}(( 
s/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Rate/IRateRepository.cs
namespace 
EasyParking
......@@ -4607,7 +4665,7 @@ h/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
;  # $
}  % &
}   
} #
} )
o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/ZonaService.cs
namespace 
EasyParking
......@@ -4818,54 +4876,98 @@ Exceptions )
Guid)) 
id))! #
)))# $
{** 
return++ 
_zonaRepository++ "
.++" #
GetById++# *
(++* +
id+++ -
)++- .
;++. /
},, 
public-- 
Zona-- 
GetByName-- 
(-- 
string-- $
name--% )
)--) *
{.. 
return// 
_zonaRepository// "
.//" #
GetByName//# ,
(//, -
name//- 1
)//1 2
;//2 3
}00 
public11 
IReadOnlyList11 
<11 
Zona11 !
>11! "
GetByLocation11# 0
(110 1
Guid111 5
{** 
var++ 
result++ 
=++ 
_zonaRepository++ (
.++( )
GetById++) 0
(++0 1
id++1 3
)++3 4
;++4 5
if,, 
(,, 
result,, 
==,, 
null,, 
),, 
throw-- 
new-- 
Core-- 
.-- 
locationId116 @
)11@ A
{22 
return33 
_zonaRepository33 "
.33" #
GetByLocation33# 0
(330 1
Exceptions-- )
.--) *
ZonaNotFoundExeption--* >
(--> ?
)--? @
;--@ A
return.. 
result.. 
;.. 
}// 
public00 
Zona00 
GetByName00 
(00 
string00 $
name00% )
)00) *
{11 
var22 
result22 
=22 
_zonaRepository22 (
.22( )
GetByName22) 2
(222 3
name223 7
)227 8
;228 9
if33 
(33 
result33 
==33 
null33 
)33 
throw44 
new44 
Core44 
.44 
locationId331 ;
)33; <
;33< =
}44 
}55 
}66 
\ No newline at end of file
Exceptions44 )
.44) *
ZonaNotFoundExeption44* >
(44> ?
)44? @
;44@ A
return55 
result55 
;55 
}77 
public88 
IReadOnlyList88 
<88 
Zona88 !
>88! "
GetByLocation88# 0
(880 1
Guid881 5
locationId886 @
)88@ A
{99 
return:: 
_zonaRepository:: "
.::" #
GetByLocation::# 0
(::0 1
locationId::1 ;
)::; <
;::< =
};; 
}<< 
}== 
\ No newline at end of file
......
......@@ -204,7 +204,7 @@ y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy

  

# '        (       3 9
# '        (       3 9
u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingService.cs
 
 
......@@ -215,7 +215,7 @@ u/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy

  

 (            0   D S         ! ' 6 : C G           * >           * >       * B 1 6      / !!  ##  ## ! ##: @ %%  ''  ''  '' & ''5 9 ))  **  **  ++  ++  ++* > ,,  --  --! % ..  ..  ..* B 00@ D
 (            0   D S         ! ' 6 : C G           * >           * >       * B 1 6      / !!  ##  ## ! ##: @ %%  ''  '' ! ''. 4 ''C G ))  **  **  ++  ++  ++* > ,,  --  --! % ..  ..  ..* B 00@ D 22 
y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Parking/ParkingTransaction.cs
 
  
......@@ -227,7 +227,7 @@ y/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy

$ ' 

) ,                  #                # % (
) ,                  #                   & *         !!  $$  $$  $$ # $$% (
s/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Rate/IRateRepository.cs
 
 
......@@ -372,7 +372,7 @@ h/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy

( + 

- 0                #
- 0                #
o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Core/Zona/ZonaService.cs
 
 
......@@ -383,4 +383,4 @@ o/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy

  

 *           & *     * D            $     * >     & *     * D !!  !!  !!  %%  %%  %% ! ''  ))  ))  ))  ++  --  --  -- $ //  11  11  11 ! 111 5 33 
\ No newline at end of file
 *           & *     * D            $     * >     & *     * D !!  !!  !!  %%  %%  %% ! ''  ))  ))  ))  ++  ,,  ,,  --  --  --* > ..  00  00  00 $ 22  33  33  44  44  44* > 55  88  88  88 ! 881 5 :: 
\ No newline at end of file
......

z/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Mapper/UserMapper.cs  8r
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnorstuvwxyz{|}~Q
 (*+,-./08:;<=>?@AIKLMNVXYZ[\]eghijklmnoy{|}~

z/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Mapper/UserMapper.cs  8r
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]_abcdefghijklmnopqtuvwxyz{|}~S
 (*+,-./08:;<=>?@AIKLMNVXYZ[\]gijklmnopq{}~
/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Repositories/BaseEntity.cs 8r


......@@ -20,9 +20,9 @@ z/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy


/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Repositories/Location/LocationRepository.cs 8 rK
 !"#$%&'()*+,-/0123456789:<=>?@ABCDEFGIKLMNOPRSTx $%)*+,1345679>?ABCDEFMNOP
/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Repositories/Parking/ParkingRepository.cs 8 rI
 !"#$%&'()*+-./012345789:;<=>?ABCDEFGHIJKLMNOx""#$%&'()*/012349:;<=>CDEFGHJK
 !"#$%&'()*+,-/0123456789:<=>?@ABCDEFGIKLMNOPRSTx $%)*+,1345679>?ABCDEFMNOP
/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Repositories/Parking/ParkingRepository.cs 8 rH
 !"#$%&'()*+,./01234679:;<=>?@ABDEFGHIJKLMNOx!"#$%&'()*+012346;<=>?@AFGHJK
/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Repositories/Parking/ParkingTransaction.cs 8r

/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Repositories/Rate/Rate.cs 8r  
......


z/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/EasyParking.Infrastructure/Mapper/UserMapper.cs
 &
......@@ -31,31 +31,33 @@ z/Users/adnan/Documents/easy-parking-new/backendApi/easyparking/EasyParking/Easy
TT. 9F