use of android.speech.tts.TextToSpeech in project robolectric by robolectric.
the class ShadowTextToSpeechTest method isShutdown_shouldReturnFalseBeforeShutdown.
@Test
public void isShutdown_shouldReturnFalseBeforeShutdown() {
TextToSpeech textToSpeech = new TextToSpeech(activity, result -> {
});
assertThat(shadowOf(textToSpeech).isShutdown()).isFalse();
}
use of android.speech.tts.TextToSpeech in project robolectric by robolectric.
the class ShadowTextToSpeechTest method isShutdown_shouldReturnTrueAfterShutdown.
@Test
public void isShutdown_shouldReturnTrueAfterShutdown() {
TextToSpeech textToSpeech = new TextToSpeech(activity, result -> {
});
textToSpeech.shutdown();
assertThat(shadowOf(textToSpeech).isShutdown()).isTrue();
}
use of android.speech.tts.TextToSpeech in project robolectric by robolectric.
the class ShadowTextToSpeechTest method isLanguageAvailable_matchingCountry_returnsLangCountryAvailable.
@Test
public void isLanguageAvailable_matchingCountry_returnsLangCountryAvailable() {
TextToSpeech textToSpeech = new TextToSpeech(activity, result -> {
});
ShadowTextToSpeech.addLanguageAvailability(new Locale.Builder().setLanguage("en").setRegion("us").setVariant("ONETW").build());
assertThat(textToSpeech.isLanguageAvailable(new Locale.Builder().setLanguage("en").setRegion("us").setVariant("THREE").build())).isEqualTo(TextToSpeech.LANG_COUNTRY_AVAILABLE);
}
use of android.speech.tts.TextToSpeech in project robolectric by robolectric.
the class ShadowTextToSpeechTest method getSpokenTextList_neverSpoke_returnsEmpty.
@Test
public void getSpokenTextList_neverSpoke_returnsEmpty() {
TextToSpeech textToSpeech = new TextToSpeech(activity, result -> {
});
assertThat(shadowOf(textToSpeech).getSpokenTextList()).isEmpty();
}
use of android.speech.tts.TextToSpeech in project robolectric by robolectric.
the class ShadowTextToSpeechTest method isLanguageAvailable_matchingVariant_returnsCountryVarAvailable.
@Test
public void isLanguageAvailable_matchingVariant_returnsCountryVarAvailable() {
TextToSpeech textToSpeech = new TextToSpeech(activity, result -> {
});
ShadowTextToSpeech.addLanguageAvailability(new Locale.Builder().setLanguage("en").setRegion("us").setVariant("WOLTK").build());
assertThat(textToSpeech.isLanguageAvailable(new Locale.Builder().setLanguage("en").setRegion("us").setVariant("WOLTK").build())).isEqualTo(TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE);
}
Aggregations