Examples of DIAspectRatioFunction


Examples of com.volantis.mcs.expression.functions.diselect.DIAspectRatioFunction

     * Return the {@link DIAspectRatioFunction} that should be used in tests.
     *
     * @return DIAspectRatioFunction to be used in tests.
     */
    public DIAspectRatioFunction getFunction() {
        return new DIAspectRatioFunction();
    }
View Full Code Here

Examples of com.volantis.mcs.expression.functions.diselect.DIAspectRatioFunction

        accessorMock.expects.getDependentPolicyValue(
                DevicePolicyConstants.ACTUAL_WIDTH_IN_PIXELS).
                returns(pixelWidth);

        // test!
        DIAspectRatioFunction function = getFunction();
        Value result = function.execute(exprContext, accessorMock,
                defaultValue);

        // checks that result is as expected
        if (outputFormat ==
                DIAspectRatioFunction.AspectRatioOutputFormat.RATIO) {
View Full Code Here

Examples of com.volantis.mcs.expression.functions.diselect.DIAspectRatioFunction

    /**
     * Verify that attempting to find the GCD with a zero parameter results in
     * the non zero parameter value being returned.
     */
    public void testFindGreatestCommonDenominatorWithAZeroParameter() {
        DIAspectRatioFunction function = getFunction();
        int gcd = function.findGreatestCommonDenominator(0, 450);
        assertEquals(450, gcd);

        gcd = function.findGreatestCommonDenominator(450, 0);
        assertEquals(450, gcd);
    }
View Full Code Here

Examples of com.volantis.mcs.expression.functions.diselect.DIAspectRatioFunction

    /**
     * Verify that attempting to find the GCD with two zero parameters results
     * in zero being returned.
     */
    public void testFindGreatestCommonDenominatorWithTwoZeroParameters() {
        DIAspectRatioFunction function = getFunction();
        int gcd = function.findGreatestCommonDenominator(0, 0);
        assertEquals(0, gcd);
    }
View Full Code Here

Examples of com.volantis.mcs.expression.functions.diselect.DIAspectRatioFunction

    /**
     * Verify that attempting to find the GCD with two non zero parameters
     * results in the GCD being returned.
     */
    public void testFindGreatestCommonDenominatorWithNonZeroParameters() {
        DIAspectRatioFunction function = getFunction();
        int gcd = function.findGreatestCommonDenominator(600, 450);
        assertEquals(150, gcd);

        gcd = function.findGreatestCommonDenominator(450, 600);
        assertEquals(150, gcd);

        gcd = function.findGreatestCommonDenominator(870, 420);
        assertEquals(30, gcd);
    }
View Full Code Here
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.