Exemplo n.º 1
0
  @Test
  public void testEvaluateTrue2() throws Exception {
    ContainsFunction containsFunction = new ContainsFunction();

    Boolean result = (Boolean) containsFunction.evaluate("not contains 2", 2);

    Assert.assertTrue(result);
  }
Exemplo n.º 2
0
  @Test
  public void testEvaluateTrue1() throws Exception {
    ContainsFunction containsFunction = new ContainsFunction();

    Boolean result = (Boolean) containsFunction.evaluate("another text", "another");

    Assert.assertTrue(result);
  }
Exemplo n.º 3
0
  @Test
  public void testEvaluateFalse4() throws Exception {
    ContainsFunction containsFunction = new ContainsFunction();

    Boolean result = (Boolean) containsFunction.evaluate("text", "simple text");

    Assert.assertFalse(result);
  }
Exemplo n.º 4
0
  @Test
  public void testEvaluateFalse2() throws Exception {
    ContainsFunction containsFunction = new ContainsFunction();

    Boolean result = (Boolean) containsFunction.evaluate(null, "not contains");

    Assert.assertFalse(result);
  }
Exemplo n.º 5
0
  @Test
  public void testCaseInsensitiveComparison() throws Exception {
    ContainsFunction containsFunction = new ContainsFunction();

    Boolean result = (Boolean) containsFunction.evaluate("Some test", "Test");

    Assert.assertTrue(result);
  }
Exemplo n.º 6
0
  @Test(expected = IllegalArgumentException.class)
  public void testEvaluateInvalid() throws Exception {
    ContainsFunction containsFunction = new ContainsFunction();

    containsFunction.evaluate("test");
  }