appmattus / kotlinfixture

Fixtures for Kotlin providing generated values for unit testing
Apache License 2.0
265 stars 15 forks source link

How to add proprety infix function #109

Open hungrytech opened 2 months ago

hungrytech commented 2 months ago

Thank you for creating the wonderful fixtures library. While using public member properties overridden by reference, I thought it would be more convenient if it could be used as an infix function like below. What do you think about adding an infix function?

Here is the example code

data class Foo(
val bar: String
)

@Test 
fun `test`() {
  val foo = fixture {
      Foo::bar property { "bar" }
  }

}
hungrytech commented 2 months ago

I have submitted a PR #110 with the infix function implementation. I would appreciate it if you could review it. Thank you.