-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed failing CI https://github.com/picortex/bitframe/runs/3970574590…
- Loading branch information
Showing
3 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import bitframe.authentication.users.User | |
import contacts.Email | ||
import kotlinx.serialization.json.Json | ||
import pimonitor.monitors.CooperateMonitor | ||
import pimonitor.monitors.CooperateMonitor.ContactPerson | ||
import pimonitor.monitors.IndividualMonitor | ||
import pimonitor.monitors.Monitor | ||
import kotlin.test.Test | ||
|
@@ -14,25 +15,25 @@ class MonitorsSerializationTest { | |
|
||
@Test | ||
fun should_serialize_an_individual_monitor() { | ||
val monitor: Monitor = IndividualMonitor( | ||
val monitor = IndividualMonitor( | ||
uid = "none", | ||
name = "John Doe", | ||
email = Email("[email protected]"), | ||
userRef = userRef | ||
) | ||
val json = Json.encodeToString(Monitor.serializer(), monitor) | ||
val json = Json.encodeToString(IndividualMonitor.serializer(), monitor) | ||
println(json) | ||
} | ||
|
||
@Test | ||
fun should_de_serialize_a_cooperate_monitor() { | ||
val monitor: Monitor = CooperateMonitor( | ||
val monitor = CooperateMonitor( | ||
uid = "none", | ||
name = "John Doe", | ||
email = Email("[email protected]"), | ||
person = CooperateMonitor.ContactPerson("", "Anderson", Email("[email protected]"), userRef) | ||
person = ContactPerson("", "Anderson", Email("[email protected]"), userRef) | ||
) | ||
val json = Json.encodeToString(Monitor.serializer(), monitor) | ||
val json = Json.encodeToString(CooperateMonitor.serializer(), monitor) | ||
println(json) | ||
} | ||
} |