i-3: Add Mokkery as a mocking library #6
@ -0,0 +1,10 @@
|
||||
package com.tle.astrologylibrary
|
||||
|
||||
@OpenForMokkery
|
||||
class A constructor()
|
||||
@OpenForMokkery
|
||||
class B constructor()
|
||||
class Subject(a: A, b: B) {
|
||||
val a: A = a
|
||||
val b: B = b
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.tle.astrologylibrary
|
||||
|
||||
import dev.mokkery.mock
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class SubjectTest {
|
||||
@Test
|
||||
fun testCreateSubject() {
|
||||
val a = mock<A> {}
|
||||
val b = mock<B> {}
|
||||
val subject = Subject(a, b)
|
||||
assertEquals(a, subject.a)
|
||||
assertEquals(b, subject.b)
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user