use of de.prob.prolog.term.ListPrologTerm in project prob2 by bendisposto.
the class GetStateBasedErrorsCommandTest method testErrorProcessResult1.
@Test(expected = ResultParserException.class)
public void testErrorProcessResult1() {
@SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
when(map.get("Errors")).thenReturn(new ListPrologTerm(new CompoundPrologTerm("foobar")));
GetStateBasedErrorsCommand command = new GetStateBasedErrorsCommand("state");
command.processResult(map);
}
use of de.prob.prolog.term.ListPrologTerm in project prob2 by bendisposto.
the class GetErrorsCommandTest method testProcessResults.
@Test
public void testProcessResults() {
@SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
when(map.get(anyString())).thenReturn(new ListPrologTerm(new CompoundPrologTerm("foobar")));
GetErrorsCommand command = new GetErrorsCommand();
command.processResult(map);
List<String> errors = command.getErrors();
assertEquals("foobar", errors.get(0));
}
use of de.prob.prolog.term.ListPrologTerm in project prob2 by bendisposto.
the class GetPreferencesCommandTest method testProcessResultsFail.
@Test(expected = ResultParserException.class)
public void testProcessResultsFail() {
@SuppressWarnings("unchecked") ISimplifiedROMap<String, PrologTerm> map = mock(ISimplifiedROMap.class);
when(map.get(anyString())).thenReturn(new ListPrologTerm(new CompoundPrologTerm("blah blah blah")));
GetDefaultPreferencesCommand command = new GetDefaultPreferencesCommand();
command.processResult(map);
}
Aggregations