ivano
01/30/2020, 8:18 AMmakeCashPeriod()
I get a nice randomized model, but I need to change some of the parameters depending by the test. Can I achieve that with the language from intelliJ usign something ,do not know, maybe generics, default constructor values, other?Czar
01/30/2020, 8:51 AMCashPeriod
constructor to makeCashPeriod
function.
That way if you don't specify a parameter, it will be random, if you do, it will be whatever you specified.ivano
01/30/2020, 9:20 AMivano
01/30/2020, 9:23 AMivano
01/30/2020, 9:23 AMivano
01/30/2020, 9:23 AMfun makeCashPeriod(
period: String = randomString(),
status: String = randomString(),
type: String = randomString(),
numberOfEntries: Int = randomInt(),
isCashCountRequired: Boolean = randomBoolean(),
mutationBalance: String = randomString(),
canBeClosed: Boolean = randomBoolean(),
remark: String = randomString()
)CashPeriod = CashPeriod(period, status, type, numberOfEntries, isCashCountRequired, mutationBalance, canBeClosed, remark)