Skip to content

Commit

Permalink
Adjust provideDifferentQrCodeTypeTexts for parameterized test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonScholz committed Oct 15, 2023
1 parent c5042d4 commit 84b9bea
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.google.zxing.common.HybridBinarizer
import com.google.zxing.multi.qrcode.QRCodeMultiReader
import io.github.simonscholz.qrcode.types.SimpleTypes
import io.github.simonscholz.qrcode.types.VCard
import io.github.simonscholz.qrcode.types.VEvent
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.params.ParameterizedTest
Expand All @@ -17,6 +18,7 @@ import org.junit.jupiter.params.provider.MethodSource
import java.awt.Color
import java.awt.image.BufferedImage
import java.net.URL
import java.time.LocalDateTime
import java.util.Objects
import javax.imageio.ImageIO

Expand Down Expand Up @@ -113,13 +115,34 @@ class ReadCreatedQrCodeTest {
companion object {
@JvmStatic
fun provideDifferentQrCodeTypeTexts(): List<Arguments> {
val url = SimpleTypes.url("https://simonscholz.github.io/")
val geolocation = SimpleTypes.geolocation(53.59659752940634, 10.006589989354053)
val email = SimpleTypes.email("simon@example.com")
val phoneNumber = SimpleTypes.phoneNumber("+49 176 12345678")
val sms = SimpleTypes.sms("+49 176 12345678", "Hello World")
val startDateTime = LocalDateTime.now()
.plusWeeks(2)
val vevent = VEvent.Builder("QR Codes with Kotlin & Java")
.location("Java User Group Hamburg")
.startDate(startDateTime)
.endDate(startDateTime.plusHours(2))
.description("Let's create QR Codes with Kotlin & Java")
.build()
val vCard = VCard.Builder("Simon Scholz")
.email("simon@example.com")
.organization("Self Employed")
.phoneNumber("+49 176 12345678")
.website("https://simonscholz.github.io/")
.build()
return listOf(Arguments.of(vCard.toVCardQrCodeText()))
return listOf(
Arguments.of(url),
Arguments.of(geolocation),
Arguments.of(email),
Arguments.of(phoneNumber),
Arguments.of(sms),
Arguments.of(vevent.toVEventQrCodeText()),
Arguments.of(vCard.toVCardQrCodeText()),
)
}
}
}

0 comments on commit 84b9bea

Please sign in to comment.