Ian
05/07/2017, 4:33 PMaleix
05/07/2017, 5:49 PMaleix
05/07/2017, 5:50 PM"find the 1000 number" {
val iterator = (1..1000).iterator()
eventually(2.seconds) {
iterator.next() shouldBe 1000
}
}
aleix
05/07/2017, 5:50 PMdeinspanjer
05/12/2017, 7:45 PMdeinspanjer
05/12/2017, 7:46 PMval testCases = table(
headers("a","b","result")
, row(MyThing1(), MyThing2(), MyThing3())
, row(MyThing1(), null, MyThing3())
, row(MyThing1(), MyThing2(), SubclassofMyThing3())
)
deinspanjer
05/12/2017, 8:31 PMfun <A: JsonElement, B: JsonElement?, C: JsonElement?> mytable(headers: Headers3, vararg rows: Row3<A, B, C>) = Table3(headers, rows.asList())
fun <A: JsonElement, B: JsonElement?, C: JsonElement?> myrow(a: A, b: B, c: C) = Row3(a as JsonElement,b as JsonElement?,c as JsonElement?)
sergei.lebedev
05/12/2017, 9:03 PMoleksandr.samsonov
06/16/2017, 11:13 PMigor.wojda
06/20/2017, 10:45 AMnstewart
06/20/2017, 12:07 PMoverride fun beforeEach() {
super.beforeEach()
//do things
}
nstewart
06/20/2017, 12:07 PMinit
myanmarking
06/20/2017, 3:09 PMmyanmarking
06/20/2017, 3:09 PMmyanmarking
06/20/2017, 3:09 PMmyanmarking
06/20/2017, 3:09 PMgfabrego
06/20/2017, 3:27 PMigor.wojda
06/23/2017, 9:57 AMclass MyTests : BehaviorSpec() {
override fun beforeEach() {
super.beforeEach() //error
//do things
}
init {
}
}
Documentation states that Interceptors replace beforeEach, afterEach, beforeAll, and afterAll functions from KotlinTest 1.x.
, but I am not sure hwo to use themigor.wojda
06/23/2017, 10:01 AMinterceptTestCase
and interceptSpec
seem not to be called at all
class MyTests : BehaviorSpec() {
lateinit var profilePresenter: ProfilePresenter
@Mock lateinit var mockEventBus: EventBus
override fun interceptTestCase(context: TestCaseContext, test: () -> Unit) {
super.interceptTestCase(context, test)
MockitoAnnotations.initMocks(this)
profilePresenter = ProfilePresenter(mockEventBus)
test()
}
init {
\\Tests: Given\When\Then
}
}
Error
kotlin.UninitializedPropertyAccessException: lateinit property profilePresenter has not been initialized
nstewart
06/23/2017, 7:31 PMnstewart
06/23/2017, 7:32 PMinterceptTestCase
works for me, I’m not sure what you’re doing differentlyigor.wojda
06/24/2017, 11:09 AMpawel.barszcz
06/30/2017, 7:59 AMIan
06/30/2017, 5:41 PMIan
07/06/2017, 1:07 PMIan
07/06/2017, 1:08 PMthanh
07/08/2017, 11:49 PMigor.wojda
08/01/2017, 3:41 PMrjj3
08/18/2017, 2:50 PMf
with mockito in the following case:
fun x(f : (String) -> Int)
?rjj3
08/18/2017, 2:51 PM