use of de.prob.animator.domainobjects.ProBPreference in project prob2 by bendisposto.
the class GetPreferencesCommandTest method testProcessResults.
@Test
public void testProcessResults() {
@SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
when(map.get("Prefs")).thenReturn(new ListPrologTerm(new CompoundPrologTerm("preference", new CompoundPrologTerm("tinker"), new CompoundPrologTerm("tailor"), new CompoundPrologTerm("soldier"), new CompoundPrologTerm("sailor"), new CompoundPrologTerm("foo")), new CompoundPrologTerm("preference", new CompoundPrologTerm("richman"), new CompoundPrologTerm("poorman"), new CompoundPrologTerm("beggarman"), new CompoundPrologTerm("thief"), new CompoundPrologTerm("bar"))));
GetDefaultPreferencesCommand command = new GetDefaultPreferencesCommand();
command.processResult(map);
List<ProBPreference> prefs = command.getPreferences();
assertEquals(prefs.size(), 2);
ProBPreference pref1 = prefs.get(0);
assertEquals(pref1.name, "tinker");
assertEquals(pref1.type.toString(), "tailor");
assertEquals(pref1.description, "soldier");
assertEquals(pref1.category, "sailor");
assertEquals(pref1.defaultValue, "foo");
ProBPreference pref2 = prefs.get(1);
assertEquals(pref2.name, "richman");
assertEquals(pref2.type.toString(), "poorman");
assertEquals(pref2.description, "beggarman");
assertEquals(pref2.category, "thief");
assertEquals(pref2.defaultValue, "bar");
}
Aggregations