Skip to content

Commit

Permalink
fix: resolve compilation error in android instrumented tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardPaligot committed Dec 9, 2024
1 parent 414f3ac commit 83c0484
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package com.paligot.confily.core.models.factory

import com.paligot.confily.models.Address
import com.paligot.confily.models.EventLunchMenu
import com.paligot.confily.models.EventV3
import com.paligot.confily.models.EventV4
import com.paligot.confily.models.FeaturesActivated
import kotlinx.datetime.Instant

fun EventV3.Companion.builder(): EventBuilder = EventBuilder()
fun EventV4.Companion.builder(): EventBuilder = EventBuilder()

@Suppress("TooManyFunctions")
class EventBuilder {
Expand Down Expand Up @@ -36,8 +36,6 @@ class EventBuilder {
)
private var contactPhone: String? = null
private var contactEmail: String = ""
private var twitterUrl: String? = null
private var linkedinUrl: String? = null
private var faqLink: String? = ""
private var codeOfConductLink: String? = ""
private var updatedAt: Long = 0L
Expand All @@ -55,15 +53,13 @@ class EventBuilder {
fun features(features: FeaturesActivated) = apply { this.features = features }
fun contactPhone(contactPhone: String?) = apply { this.contactPhone = contactPhone }
fun contactEmail(contactEmail: String) = apply { this.contactEmail = contactEmail }
fun twitterUrl(twitterUrl: String?) = apply { this.twitterUrl = twitterUrl }
fun linkedinUrl(linkedinUrl: String?) = apply { this.linkedinUrl = linkedinUrl }
fun faqLink(faqLink: String?) = apply { this.faqLink = faqLink }
fun codeOfConductLink(codeOfConductLink: String?) =
apply { this.codeOfConductLink = codeOfConductLink }

fun updatedAt(updatedAt: Long) = apply { this.updatedAt = updatedAt }

fun build(): EventV3 = EventV3(
fun build(): EventV4 = EventV4(
id = id,
name = name,
address = address,
Expand All @@ -75,9 +71,8 @@ class EventBuilder {
features = features,
contactPhone = contactPhone,
contactEmail = contactEmail,
twitterUrl = twitterUrl,
linkedinUrl = linkedinUrl,
faqLink = faqLink,
socials = emptyList(),
codeOfConductLink = codeOfConductLink,
updatedAt = updatedAt
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package com.paligot.confily.schedules.sample.fakes

import com.paligot.confily.core.models.factory.builder
import com.paligot.confily.core.sample.BuildConfig
import com.paligot.confily.models.EventV3
import com.paligot.confily.models.EventV4
import kotlinx.datetime.Clock
import kotlin.time.Duration

object EventFake {
val event = EventV3.builder()
val event = EventV4.builder()
.id(BuildConfig.DEFAULT_EVENT)
.startDate(Clock.System.now())
.endDate(Clock.System.now().plus(Duration.parse("1d")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package com.paligot.confily.speakers.sample.fakes

import com.paligot.confily.core.models.factory.builder
import com.paligot.confily.core.sample.BuildConfig
import com.paligot.confily.models.EventV3
import com.paligot.confily.models.EventV4
import kotlinx.datetime.Clock
import kotlin.time.Duration

object EventFake {
val event = EventV3.builder()
val event = EventV4.builder()
.id(BuildConfig.DEFAULT_EVENT)
.startDate(Clock.System.now())
.endDate(Clock.System.now().plus(Duration.parse("1d")))
Expand Down

0 comments on commit 83c0484

Please sign in to comment.