Closed xpathexception closed 2 years ago
Feels like I've figured out this puzzle:
@Test
fun sampleWriteTest() {
val data = "foo"
mocker.every { sample.sampleProperty = isAny() } returns Unit
testable.writeValue(data)
mocker.verify { sample.sampleProperty = data }
}
@Test
fun sampleReadTest() {
val data = "foo"
mocker.every { sample.sampleProperty } returns data
val result = testable.readValue()
assertEquals(data, result)
}
Version 1.9.0
published with the fix.
For example, I have a class under test and a mock
I would like to write a test for methods
writeValue
andreadValue
, for example:For now I'm getting
MockSample.(get/set):sampleProperty has not been mocked
error each time I run test.How to properly write rules in this case?