@Test public void getSelectedModule() { when(academyRepository.getContent(courseId, moduleId)).thenReturn(dummyModules.get(0)); ModuleEntity moduleEntity = viewModel.getSelectedModule(); verify(academyRepository).getContent(courseId, moduleId); assertNotNull(moduleEntity); ContentEntity contentEntity = moduleEntity.contentEntity; assertNotNull(contentEntity); String content = contentEntity.getContent(); assertNotNull(content); assertEquals(content, dummyModules.get(0).contentEntity.getContent()); }
public LiveData<ModuleEntity> getSelectedModule() { return academyRepository.getContent(courseId, moduleId); }
CourseReaderViewModel extends ViewModel { public LiveData<ModuleEntity> getSelectedModule() { return academyRepository.getContent(courseId, moduleId); } }
CourseReaderViewModel extends ViewModel { public LiveData<ModuleEntity> getSelectedModule() { return academyRepository.getContent(courseId, moduleId); } CourseReaderViewModel(AcademyRepository mAcademyRepository); }
CourseReaderViewModel extends ViewModel { public LiveData<ModuleEntity> getSelectedModule() { return academyRepository.getContent(courseId, moduleId); } CourseReaderViewModel(AcademyRepository mAcademyRepository); void setSelectedCourse(String courseId); void setSelectedModule(String moduleId); LiveData<List<ModuleEntity>> getModules(); LiveData<ModuleEntity> getSelectedModule(); }
CourseReaderViewModel extends ViewModel { public LiveData<ModuleEntity> getSelectedModule() { return academyRepository.getContent(courseId, moduleId); } CourseReaderViewModel(AcademyRepository mAcademyRepository); void setSelectedCourse(String courseId); void setSelectedModule(String moduleId); LiveData<List<ModuleEntity>> getModules(); LiveData<ModuleEntity> getSelectedModule();  }