Search in sources :

Example 1 with BookSectionImpl

use of org.olat.modules.edubase.model.BookSectionImpl in project OpenOLAT by OpenOLAT.

the class EdubaseBookSectionListController method doAddBookSection.

private void doAddBookSection() {
    BookSection bookSection = new BookSectionImpl();
    wrapBookSection(bookSection);
    flc.setDirty(true);
}
Also used : BookSection(org.olat.modules.edubase.BookSection) BookSectionImpl(org.olat.modules.edubase.model.BookSectionImpl)

Example 2 with BookSectionImpl

use of org.olat.modules.edubase.model.BookSectionImpl in project OpenOLAT by OpenOLAT.

the class EdubaseManagerImplTest method getLtiLaunchUrlShoudAppendBookIdAndMandatoryPageFrom.

@Test
public void getLtiLaunchUrlShoudAppendBookIdAndMandatoryPageFrom() {
    BookSection bookSection = new BookSectionImpl();
    bookSection.setBookId(BOOK_ID);
    String baseUrl = "https://edubase.ch";
    when(edubaseModuleMock.getLtiLaunchUrl()).thenReturn(baseUrl);
    String generatedLtiUrl = sut.getLtiLaunchUrl(bookSection);
    String expectedLtiUrl = baseUrl + "/" + BOOK_ID + "/1";
    assertThat(generatedLtiUrl).isEqualTo(expectedLtiUrl);
}
Also used : BookSection(org.olat.modules.edubase.BookSection) BookSectionImpl(org.olat.modules.edubase.model.BookSectionImpl) Test(org.junit.Test)

Example 3 with BookSectionImpl

use of org.olat.modules.edubase.model.BookSectionImpl in project OpenOLAT by OpenOLAT.

the class EdubaseManagerImplTest method getLtiLaunchUrlShoudAppendPageFrom.

@Test
public void getLtiLaunchUrlShoudAppendPageFrom() {
    BookSection bookSection = new BookSectionImpl();
    bookSection.setBookId(BOOK_ID);
    Integer pageFrom = 9898;
    bookSection.setPageFrom(pageFrom);
    String baseUrl = "https://edubase.ch";
    when(edubaseModuleMock.getLtiLaunchUrl()).thenReturn(baseUrl);
    String generatedLtiUrl = sut.getLtiLaunchUrl(bookSection);
    String expectedLtiUrl = baseUrl + "/" + BOOK_ID + "/" + pageFrom;
    assertThat(generatedLtiUrl).isEqualTo(expectedLtiUrl);
}
Also used : BookSection(org.olat.modules.edubase.BookSection) BookSectionImpl(org.olat.modules.edubase.model.BookSectionImpl) Test(org.junit.Test)

Example 4 with BookSectionImpl

use of org.olat.modules.edubase.model.BookSectionImpl in project openolat by klemens.

the class EdubaseManagerImplTest method getLtiLaunchUrlShoudAppendPageFrom.

@Test
public void getLtiLaunchUrlShoudAppendPageFrom() {
    BookSection bookSection = new BookSectionImpl();
    bookSection.setBookId(BOOK_ID);
    Integer pageFrom = 9898;
    bookSection.setPageFrom(pageFrom);
    String baseUrl = "https://edubase.ch";
    when(edubaseModuleMock.getLtiLaunchUrl()).thenReturn(baseUrl);
    String generatedLtiUrl = sut.getLtiLaunchUrl(bookSection);
    String expectedLtiUrl = baseUrl + "/" + BOOK_ID + "/" + pageFrom;
    assertThat(generatedLtiUrl).isEqualTo(expectedLtiUrl);
}
Also used : BookSection(org.olat.modules.edubase.BookSection) BookSectionImpl(org.olat.modules.edubase.model.BookSectionImpl) Test(org.junit.Test)

Example 5 with BookSectionImpl

use of org.olat.modules.edubase.model.BookSectionImpl in project openolat by klemens.

the class EdubaseManagerImplTest method getLtiLaunchUrlShoudAppendBookIdAndMandatoryPageFrom.

@Test
public void getLtiLaunchUrlShoudAppendBookIdAndMandatoryPageFrom() {
    BookSection bookSection = new BookSectionImpl();
    bookSection.setBookId(BOOK_ID);
    String baseUrl = "https://edubase.ch";
    when(edubaseModuleMock.getLtiLaunchUrl()).thenReturn(baseUrl);
    String generatedLtiUrl = sut.getLtiLaunchUrl(bookSection);
    String expectedLtiUrl = baseUrl + "/" + BOOK_ID + "/1";
    assertThat(generatedLtiUrl).isEqualTo(expectedLtiUrl);
}
Also used : BookSection(org.olat.modules.edubase.BookSection) BookSectionImpl(org.olat.modules.edubase.model.BookSectionImpl) Test(org.junit.Test)

Aggregations

BookSection (org.olat.modules.edubase.BookSection)6 BookSectionImpl (org.olat.modules.edubase.model.BookSectionImpl)6 Test (org.junit.Test)4