Package com.googlecode.aviator.runtime.function.system

Source Code of com.googlecode.aviator.runtime.function.system.NowFunctionUnitTest

package com.googlecode.aviator.runtime.function.system;

import static org.junit.Assert.*;

import org.junit.Test;

import com.googlecode.aviator.runtime.type.AviatorLong;
import com.googlecode.aviator.runtime.type.AviatorObject;


public class NowFunctionUnitTest {

    @Test
    public void testCall() {
        NowFunction now = new NowFunction();
        AviatorLong aviatorLong = (AviatorLong) now.call(null, new AviatorObject[0]);

        assertEquals(System.currentTimeMillis(), (Long) aviatorLong.getValue(null), 5);
    }


    @Test(expected = IllegalArgumentException.class)
    public void testCall_WithOneArgument() {
        NowFunction now = new NowFunction();
        now.call(null, new AviatorObject[1]);
    }

}
TOP

Related Classes of com.googlecode.aviator.runtime.function.system.NowFunctionUnitTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.