@Test public void getModules() { when(academyRepository.getAllModulesByCourse(courseId)).thenReturn(dummyModules); List<ModuleEntity> moduleEntities = viewModel.getModules(); verify(academyRepository).getAllModulesByCourse(courseId); assertNotNull(moduleEntities); assertEquals(7, moduleEntities.size()); }
public LiveData<List<ModuleEntity>> getModules() { return academyRepository.getAllModulesByCourse(courseId); }
CourseReaderViewModel extends ViewModel { public LiveData<List<ModuleEntity>> getModules() { return academyRepository.getAllModulesByCourse(courseId); } }
CourseReaderViewModel extends ViewModel { public LiveData<List<ModuleEntity>> getModules() { return academyRepository.getAllModulesByCourse(courseId); } CourseReaderViewModel(AcademyRepository mAcademyRepository); }
CourseReaderViewModel extends ViewModel { public LiveData<List<ModuleEntity>> getModules() { return academyRepository.getAllModulesByCourse(courseId); } CourseReaderViewModel(AcademyRepository mAcademyRepository); void setSelectedCourse(String courseId); void setSelectedModule(String moduleId); LiveData<List<ModuleEntity>> getModules(); LiveData<ModuleEntity> getSelectedModule(); }
CourseReaderViewModel extends ViewModel { public LiveData<List<ModuleEntity>> getModules() { return academyRepository.getAllModulesByCourse(courseId); } CourseReaderViewModel(AcademyRepository mAcademyRepository); void setSelectedCourse(String courseId); void setSelectedModule(String moduleId); LiveData<List<ModuleEntity>> getModules(); LiveData<ModuleEntity> getSelectedModule();  }