Code example for BluetoothAdapter

Methods: isEnabled

0
        shadowBluetoothAdapter = shadowOf(bluetoothAdapter);
    } 
 
    @Test 
    public void testAdapterDefaultsDisabled() { 
        assertFalse(bluetoothAdapter.isEnabled());
    } 
 
    @Test 
    public void testAdapterCanBeEnabled() { 
        shadowBluetoothAdapter.setEnabled(true);
        assertTrue(bluetoothAdapter.isEnabled());
    } 
 
    @Test 
    public void canGetAndSetAddress() throws Exception { 
        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
        shadowOf(adapter).setAddress("expected");
        assertEquals("expected", adapter.getAddress());
    } 
}