sdeleuze
07/19/2019, 12:08 PMoleksiyp
07/19/2019, 12:12 PMsdeleuze
07/19/2019, 12:16 PMoleksiyp
07/19/2019, 12:21 PMoleksiyp
07/19/2019, 12:21 PMoleksiyp
07/19/2019, 12:22 PMoleksiyp
07/19/2019, 12:22 PMoleksiyp
07/19/2019, 12:22 PMoleksiyp
07/19/2019, 12:22 PMoleksiyp
07/23/2019, 5:08 AMsdeleuze
07/23/2019, 6:38 AMLeoColman
07/23/2019, 5:03 PMAny
verification.
test("Should insert the document id as the certificate token") {
val collection = mockCollection()
target.insert(certificate)
verify { collection.document(certificate.token).set(any()).get() }
}
oleksiyp
07/23/2019, 5:03 PMLeoColman
07/23/2019, 5:03 PMcollection.document(certificate.token).set(certificate)
LeoColman
07/23/2019, 5:03 PMjava.lang.AssertionError: Verification failed: call 2 of 3: DocumentReference(child of #2#4).set(any())) was not called.
LeoColman
07/23/2019, 5:04 PMverify { collection.document(certificate.token).set(certificate).get() }
it worksoleksiyp
07/23/2019, 5:04 PMLeoColman
07/23/2019, 5:05 PMoleksiyp
07/23/2019, 5:05 PMLeoColman
07/23/2019, 5:08 PMoleksiyp
07/23/2019, 5:09 PMLeoColman
07/23/2019, 5:18 PMLeoColman
07/23/2019, 5:18 PMclass Foo : FunSpec() {
data class Data(val value: String)
class Dooter {
fun doot() {}
}
class Booer {
fun boo(data: Data): Dooter {
return Dooter()
}
}
class Fooer {
fun foo(data: Data): Booer {
return Booer()
}
}
class Target(
val fooer: Fooer
) {
fun doThings(data: Data) {
fooer.foo(data).boo(data).doot()
}
}
init {
test("Test") {
val fooer = mockk<Fooer>(relaxed = true)
val target = Target(fooer)
val data = Data("Data")
target.doThings(data)
verify { fooer.foo(data).boo(data).doot() }
}
}
}
LeoColman
07/23/2019, 5:18 PMLeoColman
07/23/2019, 5:18 PMverify { fooer.foo(data).boo(any()).doot() }
LeoColman
07/23/2019, 5:18 PMLeoColman
07/23/2019, 5:19 PMoleksiyp
07/23/2019, 5:21 PMoleksiyp
07/23/2019, 5:21 PMoleksiyp
07/23/2019, 5:22 PM