use of org.olat.course.export.CourseEnvironmentMapper in project openolat by klemens.
the class KeyAndNameConverterTest method convertGroupAndAreaNameToKey_sameName.
/**
* Test with same name for area and group
*/
@Test
public void convertGroupAndAreaNameToKey_sameName() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
BGArea newArea = new MockArea(567l, "Test 1");
BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Test 1");
envMapper.getAreas().add(areaRef);
MockBusinessGroup newGroup = new MockBusinessGroup(568l, "Test 1");
BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 346l, "Test 1");
envMapper.getGroups().add(bgRef);
String convertedExp = convertExpressionNameToKey("inLearningArea(\"Test 1\") & inLearningGroup(\"Test 1\")", envMapper);
Assert.assertEquals("inLearningArea(\"567\") & inLearningGroup(\"568\")", convertedExp);
}
use of org.olat.course.export.CourseEnvironmentMapper in project openolat by klemens.
the class KeyAndNameConverterTest method convertBusinessGroupKeyToName.
@Test
public void convertBusinessGroupKeyToName() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, null, null);
envMapper.getGroups().add(bgRef);
String convertedExp = convertExpressionKeyToName("isLearningGroupFull(\"567\")", envMapper);
Assert.assertEquals("isLearningGroupFull(\"Group 1\")", convertedExp);
}
use of org.olat.course.export.CourseEnvironmentMapper in project openolat by klemens.
the class KeyAndNameConverterTest method convertGroupAndAreaKeyToName_sameKey.
@Test
public void convertGroupAndAreaKeyToName_sameKey() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
BGArea newArea = new MockArea(567l, "Area 1");
BGAreaReference areaRef = new BGAreaReference(newArea, null, null);
envMapper.getAreas().add(areaRef);
MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, null, null);
envMapper.getGroups().add(bgRef);
String convertedExp = convertExpressionKeyToName("inLearningArea(\"567\") & isLearningGroupFull(\"567\")", envMapper);
Assert.assertEquals("inLearningArea(\"Area 1\") & isLearningGroupFull(\"Group 1\")", convertedExp);
}
use of org.olat.course.export.CourseEnvironmentMapper in project openolat by klemens.
the class KeyAndNameConverterTest method convertAreaKeyToName.
@Test
public void convertAreaKeyToName() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
BGArea newArea = new MockArea(567l, "Area 1");
BGAreaReference areaRef = new BGAreaReference(newArea, null, null);
envMapper.getAreas().add(areaRef);
String convertedExp = convertExpressionKeyToName("inLearningArea(\"567\")", envMapper);
Assert.assertEquals("inLearningArea(\"Area 1\")", convertedExp);
}
use of org.olat.course.export.CourseEnvironmentMapper in project openolat by klemens.
the class KeyAndNameConverterTest method convertBusinessGroupNameToKey.
@Test
public void convertBusinessGroupNameToKey() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
MockBusinessGroup newGroup = new MockBusinessGroup(567l, "Group 1");
BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 345l, "Group 1");
envMapper.getGroups().add(bgRef);
String convertedExp = convertExpressionNameToKey("inLearningGroup(\"Group 1\")", envMapper);
Assert.assertEquals("inLearningGroup(\"567\")", convertedExp);
}
Aggregations