FileDocCategorySizeDatePackage
ScreenDimensionQualifierTest.javaAPI DocAndroid 1.5 API2212Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources.configurations

ScreenDimensionQualifierTest

public class ScreenDimensionQualifierTest extends TestCase

Fields Summary
private ScreenDimensionQualifier
sdq
private FolderConfiguration
config
Constructors Summary
Methods Summary
protected voidsetUp()

        super.setUp();
        sdq = new ScreenDimensionQualifier();
        config = new FolderConfiguration();
    
protected voidtearDown()

        super.tearDown();
        sdq = null;
        config = null;
    
public voidtestCheckAndSet()

        assertEquals(true, sdq.checkAndSet("400x200", config));//$NON-NLS-1$
        assertTrue(config.getScreenDimensionQualifier() != null);
        assertEquals(400, config.getScreenDimensionQualifier().getValue1());
        assertEquals(200, config.getScreenDimensionQualifier().getValue2());
        assertEquals("400x200", config.getScreenDimensionQualifier().toString()); //$NON-NLS-1$
    
public voidtestFailures()

        assertEquals(false, sdq.checkAndSet("", config));//$NON-NLS-1$
        assertEquals(false, sdq.checkAndSet("400X200", config));//$NON-NLS-1$
        assertEquals(false, sdq.checkAndSet("x200", config));//$NON-NLS-1$
        assertEquals(false, sdq.checkAndSet("ax200", config));//$NON-NLS-1$
        assertEquals(false, sdq.checkAndSet("400x", config));//$NON-NLS-1$
        assertEquals(false, sdq.checkAndSet("400xa", config));//$NON-NLS-1$
        assertEquals(false, sdq.checkAndSet("other", config));//$NON-NLS-1$