Skip to content
Snippets Groups Projects
Unverified Commit 7b54efe5 authored by Mohamed Metwalli's avatar Mohamed Metwalli Committed by GitHub
Browse files

Immunity state after 14 days (#3467)

parent e86a4013
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ data class VaccinatedPerson( ...@@ -39,7 +39,7 @@ data class VaccinatedPerson(
val daysToImmunity = getTimeUntilImmunity(nowUTC)?.standardDays ?: return Status.INCOMPLETE val daysToImmunity = getTimeUntilImmunity(nowUTC)?.standardDays ?: return Status.INCOMPLETE
return when { return when {
daysToImmunity <= 0 -> Status.IMMUNITY daysToImmunity < 0 -> Status.IMMUNITY
else -> Status.COMPLETE else -> Status.COMPLETE
} }
} }
......
...@@ -85,14 +85,22 @@ class VaccinatedPersonTest : BaseTest() { ...@@ -85,14 +85,22 @@ class VaccinatedPersonTest : BaseTest() {
) )
vaccinatedPerson.apply { vaccinatedPerson.apply {
// Less than 14 days
getVaccinationStatus( getVaccinationStatus(
Instant.parse("2021-04-27T12:00:00.000Z") Instant.parse("2021-04-27T12:00:00.000Z")
) shouldBe VaccinatedPerson.Status.COMPLETE ) shouldBe VaccinatedPerson.Status.COMPLETE
getVaccinationStatus( getVaccinationStatus(
Instant.parse("2021-05-10T12:00:00.000Z") Instant.parse("2021-05-10T12:00:00.000Z")
) shouldBe VaccinatedPerson.Status.COMPLETE ) shouldBe VaccinatedPerson.Status.COMPLETE
// 14 days exactly
getVaccinationStatus( getVaccinationStatus(
Instant.parse("2021-05-11T12:00:00.000Z") Instant.parse("2021-05-11T12:00:00.000Z")
) shouldBe VaccinatedPerson.Status.COMPLETE
// More than 14 days
getVaccinationStatus(
Instant.parse("2021-05-12T12:00:00.000Z")
) shouldBe VaccinatedPerson.Status.IMMUNITY ) shouldBe VaccinatedPerson.Status.IMMUNITY
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment