-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate setup for Unit Testing - along with enabling unit testing i…
…n CI/CD pipeline Signed-off-by: Abhijit Naik <[email protected]>
- Loading branch information
1 parent
0f255d3
commit 2fc7f82
Showing
3 changed files
with
122 additions
and
3 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
105 changes: 105 additions & 0 deletions
105
app/src/test/java/com/compose/weatherapplite/utils/WeatherTypeExtensionsTest.kt
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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package com.compose.weatherapplite.utils | ||
|
||
import com.compose.weatherapplite.R | ||
import com.compose.weatherapplite.presentation.model.WeatherType | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
class WeatherTypeExtensionsTest { | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for ClearSky`() { | ||
val result = WeatherType.ClearSky.toDrawable() | ||
assertEquals(R.drawable.vd_clear_sky, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for Overcast`() { | ||
val result = WeatherType.Overcast.toDrawable() | ||
assertEquals(R.drawable.vd_overcast, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for Foggy`() { | ||
val result = WeatherType.Foggy.toDrawable() | ||
assertEquals(R.drawable.vd_foggy, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for Drizzle`() { | ||
val result = WeatherType.Drizzle.toDrawable() | ||
assertEquals(R.drawable.vd_drizzle, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for Rain`() { | ||
val result = WeatherType.Rain.toDrawable() | ||
assertEquals(R.drawable.vd_rain, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for HeavyRain`() { | ||
val result = WeatherType.HeavyRain.toDrawable() | ||
assertEquals(R.drawable.vd_heavy_rain, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for SnowFall`() { | ||
val result = WeatherType.SnowFall.toDrawable() | ||
assertEquals(R.drawable.vd_snowfall, result) | ||
} | ||
|
||
@Test | ||
fun `toDrawable returns correct drawable for Thunderstorm`() { | ||
val result = WeatherType.Thunderstorm.toDrawable() | ||
assertEquals(R.drawable.vd_thunderstorm, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for ClearSky`() { | ||
val result = WeatherType.ClearSky.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_clear_sky, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for Overcast`() { | ||
val result = WeatherType.Overcast.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_overcast, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for Foggy`() { | ||
val result = WeatherType.Foggy.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_foggy, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for Drizzle`() { | ||
val result = WeatherType.Drizzle.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_drizzle, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for Rain`() { | ||
val result = WeatherType.Rain.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_rain, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for HeavyRain`() { | ||
val result = WeatherType.HeavyRain.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_heavy_rain, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for SnowFall`() { | ||
val result = WeatherType.SnowFall.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_snowfall, result) | ||
} | ||
|
||
@Test | ||
fun `toAnimatedVectorDrawable returns correct drawable for Thunderstorm`() { | ||
val result = WeatherType.Thunderstorm.toAnimatedVectorDrawable() | ||
assertEquals(R.drawable.avd_thunderstorm, result) | ||
} | ||
} |
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