unit tests for lower and uppper bounds

This commit is contained in:
Pritimay Sarkar
2024-02-17 09:43:14 +05:30
parent e64aa27f8a
commit c91657c529
2 changed files with 16 additions and 2 deletions

View File

@@ -970,7 +970,7 @@ class HemoCubeFragment : Fragment() {
return "Sickle Cell Trait"
if (ratio in 0.31..0.36)
return "Positive for Sickle Cell. HPLC for Confirmation"
if (ratio in 0.37..0.56)
if (ratio in 0.36..0.56)
return "Sickle Cell Disease"
} else {
return "Invalid"

View File

@@ -338,12 +338,19 @@ class HemoCubeFragmentTest {
}
@Test
fun testDeviceRatioClassificationSickleCellTrait() {
fun testDeviceRatioClassificationSickleCellTraitLowerBound() {
val ratio = 0.251
val result = hemoCubeFragment.deviceRatioClassification(ratio)
assertEquals("Sickle Cell Trait", result)
}
@Test
fun testDeviceRatioClassificationSickleCellTraitUpperBound() {
val ratio = 0.309
val result = hemoCubeFragment.deviceRatioClassification(ratio)
assertEquals("Sickle Cell Trait", result)
}
@Test
fun testDeviceRatioClassificationPositiveForSickleCell() {
val ratio = 0.359
@@ -351,6 +358,13 @@ class HemoCubeFragmentTest {
assertEquals("Positive for Sickle Cell. HPLC for Confirmation", result)
}
@Test
fun testDeviceRatioClassificationSickleCellDiseaseLowerBound() {
val ratio = 0.361
val result = hemoCubeFragment.deviceRatioClassification(ratio)
assertEquals("Sickle Cell Disease", result)
}
@Test
fun testDeviceRatioClassificationSickleCellDisease() {
val ratio = 0.45