Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
delete extra code
  • Loading branch information
Elena Moshnikova committed Oct 23, 2024
1 parent 483e0e6 commit 6a759f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal class YandexSpeechKitServiceIT {
}

@Test
fun `should generate ogg audio file`() {
fun `should generate ogg audio stream with validation`() {
val locale = BrnLocale.RU.locale
val voice = Voice.OKSANA.name
val speed = "1"
Expand Down
20 changes: 20 additions & 0 deletions src/test/kotlin/com/epam/brn/service/YandexSpeechKitServiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,24 @@ internal class YandexSpeechKitServiceTest {
// WHEN
assertThrows<IllegalArgumentException> { yandexSpeechKitService.validateLocaleAndVoice(locale, "") }
}

@ParameterizedTest
@ValueSource(strings = ["FILIPP", "NICK"])
fun `should success pass voice validation without Exceptions`(voice: String) {
val yandexVoices = listOf("FILIPP", "NICK")
every { timeService.now() } returns LocalDateTime.now()
every { wordsService.getVoicesForLocale("ru-ru") } returns yandexVoices
// WHEN
yandexSpeechKitService.validateLocaleAndVoice("ru-ru", voice)
}

@ParameterizedTest
@ValueSource(strings = ["ddd", "rrr"])
fun `should failed on voice validation`(voice: String) {
val yandexVoices = listOf("FILIPP", "NICK")
every { timeService.now() } returns LocalDateTime.now()
every { wordsService.getVoicesForLocale("ru-ru") } returns yandexVoices
// WHEN
assertThrows<IllegalArgumentException> { yandexSpeechKitService.validateLocaleAndVoice("ru-ru", voice) }
}
}

0 comments on commit 6a759f0

Please sign in to comment.