Slide 10
Slide 10 text
Unit Testing
Testing a service in isolation
f
r
o
m m
o
c
k i
m
p
o
r
t c
a
l
l
f
r
o
m n
a
m
e
k
o
.
t
e
s
t
i
n
g
.
s
e
r
v
i
c
e
s i
m
p
o
r
t w
o
r
k
e
r
_
f
a
c
t
o
r
y
h
e
l
l
o
_
s
v
c = w
o
r
k
e
r
_
f
a
c
t
o
r
y
(
H
e
l
l
o
S
e
r
v
i
c
e
)
a
s
s
e
r
t h
e
l
l
o
_
s
v
c
.
h
e
l
l
o
(
"
M
a
t
t
"
) =
= "
H
e
l
l
o
, M
a
t
t
"
a
s
s
e
r
t h
e
l
l
o
_
s
v
c
.
d
a
t
a
b
a
s
e
.
a
d
d
.
c
a
l
l
_
a
r
g
s
_
l
i
s
t =
= [
c
a
l
l
(
"
M
a
t
t
"
)
]
f
r
o
m n
a
m
e
k
o
.
t
e
s
t
i
n
g
.
s
e
r
v
i
c
e
s i
m
p
o
r
t w
o
r
k
e
r
_
f
a
c
t
o
r
y
d
a
t
a
b
a
s
e = s
e
t
(
)
h
e
l
l
o
_
s
v
c = w
o
r
k
e
r
_
f
a
c
t
o
r
y
(
H
e
l
l
o
S
e
r
v
i
c
e
, d
a
t
a
b
a
s
e
=
d
a
t
a
b
a
s
e
)
a
s
s
e
r
t h
e
l
l
o
_
s
v
c
.
h
e
l
l
o
(
"
M
a
t
t
"
) =
= "
H
e
l
l
o
, M
a
t
t
"
a
s
s
e
r
t d
a
t
a
b
a
s
e =
= {
"
M
a
t
t
"
}