package eu.jtzipi.project0.common.utils;

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

import static org.junit.Assert.assertEquals;

/**
 *
 * @author Langhammer, Tim | Earth >> Europe >> Potsdam |
 * {@literal @}<a href="mailto:tlhammer@mailbox.org" alt="email">mail</a> |
 * "Tolerance first"
 */
public class MiscUtilsTest {

    public MiscUtilsTest() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void testHashBoolean() {

    }

    @Test
    public void testHashString() {

    }

    @Test
    public void testHashFloat() {

    }

    @Test
    public void testHashByte() {

    }

    @Test
    public void testHashInt() {

    }

    @Test
    public void testHashShort() {

    }

    @Test
    public void testHashChar() {

    }

    @Test
    public void testHashDouble() {

    }

    @Test
    public void testHashLong() {

    }

    @Test
    public void testClamp() {
        System.out.println( "clamp" );

        int min = 0;
        int max = 100;
        int val = 101;

        int clamped = 100;
        int ret = MiscUtils.clamp( min, max, val );
        assertEquals( clamped, ret );

    }

    @Test
    public void testGetLargest() {
        System.out.println( "getLargest" );

        double q = 102010.12D;
        double q2 = 102.0D;
        double q0 = -102D;

        double ret = MiscUtils.getLargest( q, q2, q0 );
        double max = 102010.12D;

        assertEquals( max, ret, 0D );

    }

    @Test
    public void testCalcNiceNumber() {

    }

    @Test
    public void testToDouble() {
        System.out.println( "toDouble" );
        String argStr = "0";
        double expResult = 0.0;
        double result = MiscUtils.toDouble( argStr );
        assertEquals( expResult, result, 0.0 );

    }

}
