
package tmcsim.cadsimulator;

import java.io.File;
import java.util.LinkedList;
import java.util.Observer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
import junit.framework.TestCase;
import tmcsim.cadmodels.CADRoutedMessage;
import tmcsim.cadmodels.CMSInfo;
import tmcsim.cadmodels.IncidentInquiryModel_obj;
import tmcsim.client.cadclientgui.data.CADData;
import tmcsim.client.cadclientgui.data.CardfileList;
import tmcsim.client.cadclientgui.data.ChangeLog;
import tmcsim.client.cadclientgui.data.Incident;
import tmcsim.client.cadclientgui.data.IncidentEvent;
import tmcsim.client.cadclientgui.data.Unit;
import tmcsim.client.cadclientgui.enums.CADDataEnums;
import tmcsim.client.cadclientgui.enums.CADScriptTags;
import tmcsim.client.cadclientgui.enums.IncidentEnums;
import tmcsim.client.cadclientgui.enums.UnitStatusEnums;
import tmcsim.common.CADEnums;
import tmcsim.interfaces.CADClientInterface;
import tmcsim.interfaces.SimulationManagerInterface;

/**
 *
 * @author jdalbey
 */
public class GetCadDataUnitValueTest extends TestCase
{
    
    public GetCadDataUnitValueTest(String testName)
    {
        super(testName);
    }
    
    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
    }



    public void testSetCadDataUnitValue() throws Exception
    {
        System.out.println("setCadDataUnitValue");
        String unitNum = "14-13";
        CADScriptTags.UNIT_TAGS tag = CADScriptTags.UNIT_TAGS.OFFICER;
        Object value = "Joe Friday";
        Coordinator instance = new Coordinator(null);
        CADData myData = new CADData();
        Unit unit1 = new Unit("14-13");
        unit1.setStatus("10-8");
        unit1.setOfficer("Joe Friday");
        Vector<Unit> units = new Vector<Unit>();
        units.add(unit1);
        
        myData.setUnitsFromXML(units);
        instance.setCadData(myData);
        instance.setCadDataUnitValue(unitNum, tag, value);
        String result = (String) instance.getCadDataUnitValue(unitNum, tag);
        assertEquals(value, result);
        result = (String) instance.getCadDataUnitValue("", tag);
        assertTrue(result.length() == 0);
        
    }

}
