-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update screen view to sealed class
- Loading branch information
Showing
11 changed files
with
93 additions
and
32 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
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
46 changes: 46 additions & 0 deletions
46
datapipelines/src/test/java/io/customer/datapipelines/config/ScreenViewTest.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,46 @@ | ||
package io.customer.datapipelines.config | ||
|
||
import io.customer.commontest.core.JUnit5Test | ||
import org.amshove.kluent.shouldBeEqualTo | ||
import org.junit.jupiter.api.Test | ||
|
||
class ScreenViewTest : JUnit5Test() { | ||
@Test | ||
fun getScreenView_givenNamesWithMatchingCase_expectCorrectScreenView() { | ||
val screenViewAnalytics = ScreenView.getScreenView("All") | ||
val screenViewInApp = ScreenView.getScreenView("InApp") | ||
|
||
screenViewAnalytics shouldBeEqualTo ScreenView.All | ||
screenViewInApp shouldBeEqualTo ScreenView.InApp | ||
} | ||
|
||
@Test | ||
fun getScreenView_givenNamesWithDifferentCase_expectCorrectScreenView() { | ||
val screenViewAnalytics = ScreenView.getScreenView("all") | ||
val screenViewInApp = ScreenView.getScreenView("inapp") | ||
|
||
screenViewAnalytics shouldBeEqualTo ScreenView.All | ||
screenViewInApp shouldBeEqualTo ScreenView.InApp | ||
} | ||
|
||
@Test | ||
fun getScreenView_givenInvalidValue_expectFallbackScreenView() { | ||
val parsedValue = ScreenView.getScreenView("none") | ||
|
||
parsedValue shouldBeEqualTo ScreenView.All | ||
} | ||
|
||
@Test | ||
fun getScreenView_givenEmptyValue_expectFallbackScreenView() { | ||
val parsedValue = ScreenView.getScreenView(screenView = "", fallback = ScreenView.InApp) | ||
|
||
parsedValue shouldBeEqualTo ScreenView.InApp | ||
} | ||
|
||
@Test | ||
fun getScreenView_givenNull_expectFallbackScreenView() { | ||
val parsedValue = ScreenView.getScreenView(null) | ||
|
||
parsedValue shouldBeEqualTo ScreenView.All | ||
} | ||
} |
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
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