i-3: Add Mokkery as a mocking library #6

Merged
emil merged 6 commits from i-3-add-mock-library into main 2025-02-16 01:46:55 +00:00
2 changed files with 26 additions and 0 deletions
Showing only changes of commit 300bfbda1c - Show all commits

View File

@ -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
}

View File

@ -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)
}
}