/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.mcmaster.cas.matlab2smt.test;

import ca.mcmaster.cas.matlab2smt.BooleanVariableType;
import ca.mcmaster.cas.matlab2smt.CVC3Generator;
import ca.mcmaster.cas.matlab2smt.RealVariableType;
import ca.mcmaster.cas.matlab2smt.SMTLIBGenerator;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 *
 * @author matthew
 */
@RunWith(JUnit4.class)
public class RealVariableTypeTest {

    /**
     * Test of getCVC3Definition method, of class RealVariableType.
     */
    @Test
    public void testGetCVC3Definition() {
        CVC3Generator generator = new CVC3Generator();
        String variableName = "test_variable";
        RealVariableType instance = new RealVariableType();
        String expResult = "REAL";
        String result = generator.GenerateVariableType(instance);
        assertEquals(expResult, result);
    }

    /**
     * Test SMTLIB generates the correct type.
     */
    @Test
    public void testGetSMTLIBDefinition() {
        SMTLIBGenerator generator = new SMTLIBGenerator();
        String variableName = "test_variable";
        RealVariableType instance = new RealVariableType();
        String expResult = "Real";
        String result = generator.GenerateVariableType(instance);
        assertEquals(expResult, result);
    }

    /**
     * Test of equals method, of class RealVariableType.
     */
    @Test
    public void testEquals() {
        RealVariableType test = new RealVariableType();
        assertTrue(test.equals(new RealVariableType()));
        assertTrue(test.equals(test));
        assertFalse(test.equals(new Object()));
    }

    /**
     * Test of hashCode method, of class RealVariableType.
     */
    @Test
    public void testHashCode() {
        RealVariableType instance = new RealVariableType();
        assertEquals(0, instance.hashCode());
    }

    /**
     * Test of canCastToType method, of class RealVariableType.  Reals (for now)
     * don't cast.
     */
    @Test
    public void testCanCastToType() {
        RealVariableType instance = new RealVariableType();
        assertFalse(instance.canCastToType(new RealVariableType()));
        assertFalse(instance.canCastToType(new BooleanVariableType()));
    }
}
