use of org.olat.group.model.BGAreaReference in project OpenOLAT by OpenOLAT.
the class KeyAndNameConverterTest method convertAreaNameToKey.
@Test
public void convertAreaNameToKey() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
BGArea newArea = new MockArea(567l, "Area 1");
BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Area 1");
envMapper.getAreas().add(areaRef);
String convertedExp = convertExpressionNameToKey("inLearningArea(\"Area 1\")", envMapper);
Assert.assertEquals("inLearningArea(\"567\")", convertedExp);
}
use of org.olat.group.model.BGAreaReference in project OpenOLAT by OpenOLAT.
the class KeyAndNameConverterTest method convertGroupAndAreaKeyToKey_sameKey.
@Test
public void convertGroupAndAreaKeyToKey_sameKey() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
BGArea newArea = new MockArea(567l, "Area 1");
BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Area 1");
envMapper.getAreas().add(areaRef);
MockBusinessGroup newGroup = new MockBusinessGroup(568l, "Group 1");
BusinessGroupReference bgRef = new BusinessGroupReference(newGroup, 345l, "Group 1");
envMapper.getGroups().add(bgRef);
String convertedExp = convertExpressionKeyToKey("inLearningArea(\"345\") & inRightGroup(\"345\")", envMapper);
Assert.assertEquals("inLearningArea(\"567\") & inRightGroup(\"568\")", convertedExp);
}
use of org.olat.group.model.BGAreaReference in project OpenOLAT by OpenOLAT.
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.group.model.BGAreaReference in project OpenOLAT by OpenOLAT.
the class KeyAndNameConverterTest method convertAreaKeyToKey.
@Test
public void convertAreaKeyToKey() {
CourseEnvironmentMapper envMapper = new CourseEnvironmentMapper();
BGArea newArea = new MockArea(567l, "Area 1");
BGAreaReference areaRef = new BGAreaReference(newArea, 345l, "Area 1");
envMapper.getAreas().add(areaRef);
String convertedExp = convertExpressionKeyToKey("inLearningArea(\"345\")", envMapper);
Assert.assertEquals("inLearningArea(\"567\")", convertedExp);
}
use of org.olat.group.model.BGAreaReference in project OpenOLAT by OpenOLAT.
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);
}
Aggregations