mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetFactoryModel.java
@Test
    public void testGetImage()
    {
        AssetFactoryModel model = new AssetFactoryModel(PRODUCT_TYPE, m_AssetImageInterface);
        
        //0 is used for system ID since the capabilities are already known to the factory model
        assertThat(model.getImage(), is(COMMS_ICON_DFLT));
        
        List<SensingModality> sensingMods = new ArrayList<SensingModality>();
        SensingModality modal = new SensingModality();
        sensingMods.add(modal);
        
        modal.setValue(SensingModalityEnum.ACOUSTIC);
        
        AssetCapabilities assetCap = mock(AssetCapabilities.class);
        when(assetCap.getModalities()).thenReturn(sensingMods);
        
        model.setFactoryCaps(assetCap);
        
        assertThat(model.getImage(), is("thoseIcons/sensingModality/" + 
                modal.getValue().toString().toLowerCase() + ".png"));
    }
/**
     * Verify the get image method works as expected
     */
Verify the get image method works as expected
Verify the get image method works as expected
@Test
    public void testGetImage()
    {
        AssetFactoryModel model = new AssetFactoryModel(PRODUCT_TYPE, m_AssetImageInterface);
        assertThat(model.getImage(), is(COMMS_ICON_DFLT));
        List<SensingModality> sensingMods = new ArrayList<SensingModality>();
        SensingModality modal = new SensingModality();
        sensingMods.add(modal);
        modal.setValue(SensingModalityEnum.ACOUSTIC);
        AssetCapabilities assetCap = mock(AssetCapabilities.class);
        when(assetCap.getModalities()).thenReturn(sensingMods);
        model.setFactoryCaps(assetCap);
        assertThat(model.getImage(), is("thoseIcons/sensingModality/" + 
                modal.getValue().toString().toLowerCase() + ".png"));
    }
@ Test public void testGetImage ( ) { AssetFactoryModel model = new AssetFactoryModel ( PRODUCT_TYPE , m_AssetImageInterface ) ; assertThat ( model . getImage ( ) , is ( COMMS_ICON_DFLT ) ) ; List < SensingModality > sensingMods = new ArrayList < SensingModality > ( ) ; SensingModality modal = new SensingModality ( ) ; sensingMods . add ( modal ) ; modal . setValue ( SensingModalityEnum . ACOUSTIC ) ; AssetCapabilities assetCap = mock ( AssetCapabilities . class ) ; when ( assetCap . getModalities ( ) ) . thenReturn ( sensingMods ) ; model . setFactoryCaps ( assetCap ) ; assertThat ( model . getImage ( ) , is ( "thoseIcons/sensingModality/" + modal . getValue ( ) . toString ( ) . toLowerCase ( ) + ".png" ) ) ; }
Verify the get image method works as expected
Verify the get image method works as expected
//0 is used for system ID since the capabilities are already known to the factory model