Search in sources :

Example 1 with TestTrayModulePreferences

use of net.grandcentrix.tray.mock.TestTrayModulePreferences in project tray by grandcentrix.

the class SaveNull method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mPref = new TestTrayModulePreferences(getProviderMockContext(), "publictest");
}
Also used : TestTrayModulePreferences(net.grandcentrix.tray.mock.TestTrayModulePreferences)

Example 2 with TestTrayModulePreferences

use of net.grandcentrix.tray.mock.TestTrayModulePreferences in project tray by grandcentrix.

the class TrayTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    mTrayModulePref = new TestTrayModulePreferences(getProviderMockContext(), "module");
    mTray = new Tray(getProviderMockContext());
}
Also used : TestTrayModulePreferences(net.grandcentrix.tray.mock.TestTrayModulePreferences)

Example 3 with TestTrayModulePreferences

use of net.grandcentrix.tray.mock.TestTrayModulePreferences in project tray by grandcentrix.

the class TrayTest method testClearBut.

public void testClearBut() throws Exception {
    final TestTrayModulePreferences module2 = new TestTrayModulePreferences(getProviderMockContext(), "module2");
    mTrayModulePref.put("test", "test");
    module2.put("test", "test");
    mTrayModulePref.put("test2", "test");
    module2.put("test2", "test");
    assertUserDatabaseSize(4);
    assertTrue(mTray.clearBut(module2));
    assertUserDatabaseSize(2);
    final AppPreferences appPrefs = new AppPreferences(getProviderMockContext());
    appPrefs.put("test", "value");
    assertUserDatabaseSize(3);
    assertTrue(mTray.clearBut(appPrefs));
    assertUserDatabaseSize(1);
    assertTrue(mTray.clear());
    assertUserDatabaseSize(0);
}
Also used : TestTrayModulePreferences(net.grandcentrix.tray.mock.TestTrayModulePreferences)

Example 4 with TestTrayModulePreferences

use of net.grandcentrix.tray.mock.TestTrayModulePreferences in project tray by grandcentrix.

the class TrayTest method testClearAll.

public void testClearAll() throws Exception {
    final TestTrayModulePreferences module2 = new TestTrayModulePreferences(getProviderMockContext(), "module2");
    module2.put("blubb", "hello");
    mTrayModulePref.put("test", "test");
    assertUserDatabaseSize(2);
    assertTrue(mTray.clear());
    assertUserDatabaseSize(0);
}
Also used : TestTrayModulePreferences(net.grandcentrix.tray.mock.TestTrayModulePreferences)

Example 5 with TestTrayModulePreferences

use of net.grandcentrix.tray.mock.TestTrayModulePreferences in project tray by grandcentrix.

the class TrayTest method testWipe.

public void testWipe() throws Exception {
    assertEquals(1, mTrayModulePref.getVersion());
    final TestTrayModulePreferences module2 = new TestTrayModulePreferences(getProviderMockContext(), "module2");
    assertEquals(1, module2.getVersion());
    assertTrue(mTray.wipe());
    assertEquals(0, mTrayModulePref.getVersion());
    assertEquals(0, module2.getVersion());
}
Also used : TestTrayModulePreferences(net.grandcentrix.tray.mock.TestTrayModulePreferences)

Aggregations

TestTrayModulePreferences (net.grandcentrix.tray.mock.TestTrayModulePreferences)13 Uri (android.net.Uri)1 IsolatedContext (android.test.IsolatedContext)1 MockContentProvider (android.test.mock.MockContentProvider)1 AppPreferences (net.grandcentrix.tray.AppPreferences)1 TrayItem (net.grandcentrix.tray.core.TrayItem)1