package net.folab.fo.runtime._fo._lang;

import static net.folab.fo.runtime._fo._lang.Boolean.*;
import static net.folab.fo.runtime._fo._lang.Integer.*;

import net.folab.fo.runtime.Evaluable;
import net.folab.fo.runtime.Function;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class BooleanTest {

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void test() {

        Function<Evaluable<Boolean>, Function<Evaluable<Boolean>, Evaluable<Boolean>>> falseChoose = FALSE
                .choose();
        Function<Evaluable<Boolean>, Function<Evaluable<Boolean>, Evaluable<Boolean>>> trueChoose = TRUE
                .choose();

        System.out.println(falseChoose.apply(FALSE).apply(TRUE).evaluate()
                .getValue());
        System.out.println(trueChoose.apply(FALSE).apply(TRUE).evaluate()
                .getValue());

    }

    @Test
    public void testI() {

        Function<Evaluable<Integer>, Function<Evaluable<Integer>, Evaluable<Integer>>> falseChoose = FALSE
                .choose();
        Function<Evaluable<Integer>, Function<Evaluable<Integer>, Evaluable<Integer>>> trueChoose = TRUE
                .choose();

        System.out.println(falseChoose.apply(valueOf(1)).apply(valueOf(0))
                .evaluate().getValue());
        System.out.println(trueChoose.apply(valueOf(1)).apply(valueOf(0))
                .evaluate().getValue());

    }

}

@@ -150,47 +150,85 @@
 .*;%0A
-%0A
 import 
-net.folab.fo.runtime.Evaluable;
+static org.hamcrest.CoreMatchers.*;%0Aimport static org.junit.Assert.*;%0A
 %0Aimp
@@ -252,24 +252,41 @@
 runtime.
-Function
+_fo._lang._Boolean.choose
 ;%0A%0Aimpor
@@ -537,16 +537,24 @@
 oid test
+_Boolean
 () %7B%0A%0A  
@@ -563,208 +563,57 @@
     
-Function%3CEvaluable%3CBoolean%3E, Function%3CEvaluable%3CBoolean%3E, Evaluable%3CBoolean%3E%3E%3E falseChoose = FALSE%0A                .choose();%0A        Function%3CEvaluable%3CBoolean%3E, Function%3CEvaluable%3CBoolean%3E, Evaluabl
+choose%3CBoolean%3E f = FALSE.choose();%0A        choos
 e%3CBo
@@ -622,95 +622,49 @@
 ean%3E
-%3E%3E
  t
-rueChoose = TRUE%0A                .choose();%0A%0A        System.out.println(falseChoose
+ = TRUE.choose();%0A%0A        assertTrue(f
 .app
@@ -695,33 +695,16 @@
 aluate()
-%0A                
 .getValu
@@ -721,37 +721,21 @@
     
-System.out.println(trueChoose
+assertFalse(t
 .app
@@ -766,33 +766,16 @@
 aluate()
-%0A                
 .getValu
@@ -818,17 +818,24 @@
 oid test
-I
+_Integer
 () %7B%0A%0A  
@@ -844,358 +844,201 @@
     
-Function%3CEvaluable%3CInteger%3E, Function%3CEvaluable%3CInteger%3E, Evaluable%3CInteger%3E%3E%3E falseChoose = FALSE%0A                .choose();%0A        Function%3CEvaluable%3CInteger%3E, Function%3CEvaluable%3CInteger%3E, Evaluable%3CInteger%3E%3E%3E trueChoose = TRUE%0A                .choose();%0A%0A        System.out.println(falseChoose.apply(valueOf(1)).apply(valueOf(0))%0A                
+choose%3CInteger%3E f = FALSE.choose();%0A        choose%3CInteger%3E t = TRUE.choose();%0A%0A        Integer one = valueOf(1);%0A        Integer zero = valueOf(0);%0A%0A        assertThat(f.apply(one).apply(zero)
 .eva
@@ -1047,32 +1047,39 @@
 ate().getValue()
+, is(0)
 );%0A        Syste
@@ -1077,90 +1077,43 @@
     
-System.out.println(trueChoose.apply(valueOf(1)).apply(valueOf(0))%0A                
+assertThat(t.apply(one).apply(zero)
 .eva
@@ -1122,29 +1122,36 @@
 ate().getValue()
+, is(1)
 );%0A%0A    %7D%0A%0A%7D%0A

Clean up codes as test case