예제 #1
0
 @Test
 public void courseIdNotANumber() throws TmcCoreException {
   settings.setCurrentCourse(
       new TmcJsonParser(settings).getCourseFromString(ExampleJson.courseExample));
   DownloadExercises de = new DownloadExercises(new ArrayList<Exercise>(), settings);
   de.checkData();
 }
예제 #2
0
 @Test(expected = TmcCoreException.class)
 public void settingsWithoutCredentials() throws TmcCoreException {
   CoreTestSettings localSettings = new CoreTestSettings();
   localSettings.setCurrentCourse(
       new TmcJsonParser(settings).getCourseFromString(ExampleJson.courseExample));
   DownloadExercises de = new DownloadExercises(new ArrayList<Exercise>(), localSettings);
   de.checkData();
 }
예제 #3
0
 @Test
 public void constructorWithoutPathUsesTmcSettings() throws TmcCoreException {
   String path = "pentti/tmc/java";
   settings.setCurrentCourse(new Course());
   settings.setTmcMainDirectory(path);
   DownloadExercises de = new DownloadExercises(new ArrayList<Exercise>(), settings);
   assertTrue(de.data.containsKey("path"));
   assertEquals(path, de.data.get("path"));
 }