https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

Rudra Sen

10/20/2023, 6:10 PM
Hello If I want to unit test the helper/utility function within class . How should they be declared, such that they are "testable" & "observable". I do not want to make these helper methods public. What is the idiomatic approach ? Are they established pattern for this ?
j

Joffrey

10/20/2023, 6:13 PM
If these helpers are private, they should be considered implementation details. It shouldn't matter whether you inline them or not, at least from the testing standpoint. These helpers can be tested via the public API of the more general component using them.
💯 3