001 package fp;
002 import junit.framework.TestCase;
003
004 /**
005 * A JUnit test case class.
006 * Every method starting with the word "test" will be called when running
007 * the test with JUnit.
008 * @author Mathias Ricken - Copyright 2008 - All rights reserved.
009 */
010 public class Test_Add extends TestCase {
011
012 ILambda<Integer,Integer> add = Add.Singleton;
013
014 public void testAdd() {
015 System.out.println(add.apply(2, 3).getClass());
016 assertEquals("2 +3", 5, (int)add.apply(2, 3));
017 assertEquals("0 +3", 3, (int)add.apply(0, 3));
018 add.apply(2);
019 }
020
021 }