/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.functional;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public class IntProjectionFunctionTest {
    
    @Test
    public void testIdentity() {
        IntProjectionFunction a = IntProjectionFunction.identity();
        
        assertEquals(17, a.invert(17));
        assertEquals(17, a.applyAsInt(17));
    }
    
    @Test
    public void testProduce() {
        IntProjectionFunction func = IntProjectionFunction.produce(v->10*v, v->v/10);
        
        assertEquals(150, func.applyAsInt(15));
        assertEquals(12, func.invert(120));
    }
    
    
}
