1717package com.google.firebase.dataconnect.testutil
1818
1919import com.google.firebase.dataconnect.testutil.property.arbitrary.listContainingNull
20- import com.google.firebase.dataconnect.testutil.property.arbitrary.sampleFromArb
20+ import com.google.firebase.dataconnect.testutil.property.arbitrary.next
2121import io.kotest.assertions.asClue
2222import io.kotest.assertions.assertSoftly
2323import io.kotest.assertions.withClue
@@ -40,8 +40,8 @@ class ListContainingNullUnitTest {
4040 fun `listContainingNull generates values with lengths in the given range` () = runTest {
4141 checkAll(NUM_ITERATIONS , listLengthsArb) { lengthRange ->
4242 val arb = Arb .listContainingNull(valuesGen, lengthRange)
43- val sample = sampleFromArb( arb, edgeCaseProbability = 0.5 )
44- sample. value.asClue {
43+ val value = arb.next(randomSource() , edgeCaseProbability = 0.5f )
44+ value.asClue {
4545 assertSoftly {
4646 it.size shouldBeGreaterThanOrEqual lengthRange.first
4747 it.size shouldBeLessThanOrEqual lengthRange.last
@@ -54,8 +54,8 @@ class ListContainingNullUnitTest {
5454 fun `listContainingNull generates values from the given arb` () = runTest {
5555 checkAll(NUM_ITERATIONS , listLengthsArb) { lengthRange ->
5656 val arb = Arb .listContainingNull(valuesGen, lengthRange)
57- val sample = sampleFromArb( arb, edgeCaseProbability = 0.5 )
58- sample. value.asClue {
57+ val value = arb.next(randomSource() , edgeCaseProbability = 0.5f )
58+ value.asClue {
5959 assertSoftly {
6060 it.forEachIndexed { index, value ->
6161 if (value != = null ) {
@@ -71,8 +71,8 @@ class ListContainingNullUnitTest {
7171 fun `listContainingNull generates lists that always contain null` () = runTest {
7272 checkAll(NUM_ITERATIONS , listLengthsArb) { lengthRange ->
7373 val arb = Arb .listContainingNull(valuesGen, lengthRange)
74- val sample = sampleFromArb( arb, edgeCaseProbability = 0.5 )
75- sample. value.asClue { it shouldContain null }
74+ val value = arb.next(randomSource() , edgeCaseProbability = 0.5f )
75+ value.asClue { it shouldContain null }
7676 }
7777 }
7878
0 commit comments