Add unit tests with mocking
This commit is contained in:
parent
6f762a40eb
commit
300bfbda1c
@ -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