Search in sources :

Example 1 with CheckBooleanPropertyCommand

use of de.prob.animator.command.CheckBooleanPropertyCommand in project prob2 by bendisposto.

the class CheckBooleanPropertyCommandTest method testProcessIllegalResult.

@Test(expected = ResultParserException.class)
public void testProcessIllegalResult() {
    ISimplifiedROMap<String, PrologTerm> map = TestHelper.mkAtomMock("PropResult", "fff");
    CheckBooleanPropertyCommand cmd = new CheckBooleanPropertyCommand("BLAH_BLAH", "root");
    cmd.processResult(map);
}
Also used : CheckBooleanPropertyCommand(de.prob.animator.command.CheckBooleanPropertyCommand) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 2 with CheckBooleanPropertyCommand

use of de.prob.animator.command.CheckBooleanPropertyCommand in project prob2 by bendisposto.

the class CheckBooleanPropertyCommandTest method testProcessResultTrue.

@Test
public void testProcessResultTrue() {
    ISimplifiedROMap<String, PrologTerm> map = TestHelper.mkAtomMock("PropResult", "true");
    CheckBooleanPropertyCommand cmd = new CheckBooleanPropertyCommand("BLAH_BLAH", "root");
    cmd.processResult(map);
    assertTrue(cmd.getResult());
}
Also used : CheckBooleanPropertyCommand(de.prob.animator.command.CheckBooleanPropertyCommand) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 3 with CheckBooleanPropertyCommand

use of de.prob.animator.command.CheckBooleanPropertyCommand in project prob2 by bendisposto.

the class CheckBooleanPropertyCommandTest method testWriteCommand.

@Test
public void testWriteCommand() {
    CheckBooleanPropertyCommand cmd = new CheckBooleanPropertyCommand("A_DINGO_ATE_MY_BABY", "root");
    IPrologTermOutput pto = mock(IPrologTermOutput.class);
    cmd.writeCommand(pto);
    verify(pto).openTerm("state_property");
    verify(pto).printVariable(anyString());
    verify(pto).printAtomOrNumber("root");
    verify(pto).printAtom("A_DINGO_ATE_MY_BABY");
}
Also used : CheckBooleanPropertyCommand(de.prob.animator.command.CheckBooleanPropertyCommand) IPrologTermOutput(de.prob.prolog.output.IPrologTermOutput) Test(org.junit.Test)

Example 4 with CheckBooleanPropertyCommand

use of de.prob.animator.command.CheckBooleanPropertyCommand in project prob2 by bendisposto.

the class CheckBooleanPropertyCommandTest method testProcessResultFalse.

@Test
public void testProcessResultFalse() {
    ISimplifiedROMap<String, PrologTerm> map = TestHelper.mkAtomMock("PropResult", "false");
    CheckBooleanPropertyCommand cmd = new CheckBooleanPropertyCommand("BLAH_BLAH", "root");
    cmd.processResult(map);
    assertFalse(cmd.getResult());
}
Also used : CheckBooleanPropertyCommand(de.prob.animator.command.CheckBooleanPropertyCommand) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 5 with CheckBooleanPropertyCommand

use of de.prob.animator.command.CheckBooleanPropertyCommand in project prob2 by bendisposto.

the class CheckBooleanPropertyCommandTest method testProcessResultNull.

@Test(expected = IllegalStateException.class)
public void testProcessResultNull() {
    CheckBooleanPropertyCommand cmd = new CheckBooleanPropertyCommand("BLAH_BLAH", "root");
    cmd.getResult();
}
Also used : CheckBooleanPropertyCommand(de.prob.animator.command.CheckBooleanPropertyCommand) Test(org.junit.Test)

Aggregations

CheckBooleanPropertyCommand (de.prob.animator.command.CheckBooleanPropertyCommand)5 Test (org.junit.Test)5 PrologTerm (de.prob.prolog.term.PrologTerm)3 IPrologTermOutput (de.prob.prolog.output.IPrologTermOutput)1