Search in sources :

Example 1 with PageProvider

use of com.quran.data.source.PageProvider in project quran_android by quran.

the class AudioUtilsTest method testGetLastAyahWithNewSurahOnNextPageForMadani.

@Test
public void testGetLastAyahWithNewSurahOnNextPageForMadani() throws Exception {
    PageProvider pageProviderMock = Mockito.mock(PageProvider.class);
    when(pageProviderMock.getDataSource()).thenReturn(new MadaniDataSource());
    QuranInfo quranInfoMock = new QuranInfo(pageProviderMock);
    AudioUtils audioUtils = new AudioUtils(quranInfoMock, null);
    SuraAyah lastAyah = audioUtils.getLastAyahToPlay(new SuraAyah(109, 1), 603, 1, false);
    assertTrue(lastAyah.ayah == 5);
    assertTrue(lastAyah.sura == 111);
}
Also used : PageProvider(com.quran.data.source.PageProvider) MadaniDataSource(com.quran.data.pageinfo.common.MadaniDataSource) QuranInfo(com.quran.labs.androidquran.data.QuranInfo) SuraAyah(com.quran.labs.androidquran.data.SuraAyah) Test(org.junit.Test)

Aggregations

MadaniDataSource (com.quran.data.pageinfo.common.MadaniDataSource)1 PageProvider (com.quran.data.source.PageProvider)1 QuranInfo (com.quran.labs.androidquran.data.QuranInfo)1 SuraAyah (com.quran.labs.androidquran.data.SuraAyah)1 Test (org.junit.Test)1