package progen.kernel.functions;

import org.junit.Before;
import org.junit.Test;
import progen.kernel.functions.False;
import progen.kernel.functions.Terminal;
import progen.kernel.tree.Node;
import progen.userprogram.UserProgram;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * @author jirsis
 * @since 2.0
 */
public class FalseTest {

  private False falseFunction;

  @Before
  public void setUp() {
    falseFunction = new False();
  }

  @Test
  public void trueTest() {
    assertTrue(falseFunction instanceof Terminal);
    assertTrue(falseFunction.getArity() == 0);
    assertTrue(falseFunction.getReturnType().equals("boolean"));
    assertTrue(falseFunction.getSignature().equals("boolean"));
    assertTrue(falseFunction.getSymbol().equals("FALSE"));
    assertTrue(falseFunction.getValue().equals(false));

  }

  @Test
  public void evaluateTest() {
    List<Node> arguments = new ArrayList<Node>();
    UserProgram userProgram = null;
    HashMap<String, Object> returnAddr = null;
    assertFalse((Boolean) falseFunction.evaluate(arguments, userProgram, returnAddr));
  }

}

@@ -304,16 +304,61 @@
 .List;%0A%0A
+import static org.junit.Assert.assertEquals;%0A
 import s
@@ -695,37 +695,42 @@
 nal);%0A    assert
-True(
+Equals(0, 
 falseFunction.ge
@@ -741,13 +741,8 @@
 ty()
- == 0
 );%0A 
@@ -742,37 +742,50 @@
 y());%0A    assert
-True(
+Equals(%22boolean%22, 
 falseFunction.ge
@@ -797,18 +797,30 @@
 rnType()
-.e
+);%0A    assertE
 quals(%22b
@@ -826,35 +826,18 @@
 boolean%22
-));%0A    assertTrue(
+, 
 falseFun
@@ -860,103 +860,89 @@
 re()
-.equals(%22boolean%22));%0A    assertTrue(falseFunction.getSymbol().equals(%22FALSE%22));%0A    assertTrue(
+);%0A    assertEquals(%22FALSE%22, falseFunction.getSymbol());%0A    assertEquals(false, 
 fals
@@ -965,26 +965,11 @@
 ue()
-.equals(false)
 );%0A
-%0A
   %7D%0A
@@ -1231,12 +1231,361 @@
 r));%0A  %7D
+%0A %0A  @Test%0A  public void setValueTest()%7B%0A    falseFunction.setValue(null);%0A    assertEquals(0, falseFunction.getArity());%0A    assertEquals(%22boolean%22, falseFunction.getReturnType());%0A    assertEquals(%22boolean%22, falseFunction.getSignature());%0A    assertEquals(%22FALSE%22, falseFunction.getSymbol());%0A    assertEquals(false, falseFunction.getValue());%0A  %7D
 %0A%0A%7D%0A

Refactor de test