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");
}
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());
}
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);
}
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);
}
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());
}
Aggregations