Run Parameterized Tests — Weak Accesses vs Constructor

Today I started adding some parameterized tests to my app, and I realised that there are not much documentation for Kotlin.

Anyway, the difficulty shouldn’t be really high as it’s much as it was in Java, except for Weak Accesses. I will try to make this as a manual to achieve a good test suite.

I want to talk about the difference between the Constructor access and the Weak access.

Imagine we want to do Unit tests in a RectangleModel like:

Note that you will have to use @JvmField annotation otherwise Java will see that parameter private if you’re coding in Kotlin!

Which one would you use, and why?
Comments are well received!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store