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

NetworkCodeQualifierTest

public class NetworkCodeQualifierTest extends TestCase

Fields Summary
private NetworkCodeQualifier
mncq
private FolderConfiguration
config
Constructors Summary
Methods Summary
protected voidsetUp()

        super.setUp();
        mncq = new NetworkCodeQualifier();
        config = new FolderConfiguration();
    
protected voidtearDown()

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

        assertEquals(true, mncq.checkAndSet("mnc123", config));//$NON-NLS-1$
        assertTrue(config.getNetworkCodeQualifier() != null);
        assertEquals(123, config.getNetworkCodeQualifier().getCode());
        assertEquals("mnc123", config.getNetworkCodeQualifier().toString()); //$NON-NLS-1$
    
public voidtestFailures()

        assertEquals(false, mncq.checkAndSet("", config));//$NON-NLS-1$
        assertEquals(false, mncq.checkAndSet("mnc", config));//$NON-NLS-1$
        assertEquals(false, mncq.checkAndSet("MNC123", config));//$NON-NLS-1$
        assertEquals(false, mncq.checkAndSet("123", config));//$NON-NLS-1$
        assertEquals(false, mncq.checkAndSet("mncsdf", config));//$NON-NLS-1$