Search in sources :

Example 6 with MockOneSignalDBHelper

use of com.onesignal.MockOneSignalDBHelper in project OneSignal-Android-SDK by OneSignal.

the class MainOneSignalClassRunner method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    blankActivityController = Robolectric.buildActivity(BlankActivity.class).create();
    blankActivity = blankActivityController.get();
    time = new MockOSTimeImpl();
    trackerFactory = new OSTrackerFactory(new MockOSSharedPreferences(), new MockOSLog(), time);
    sessionManager = new MockSessionManager(OneSignal_getSessionListener(), trackerFactory, new MockOSLog());
    dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
    TestHelpers.setupTestWorkManager(blankActivity);
    cleanUp();
    OneSignal_setTime(time);
}
Also used : MockOSLog(com.onesignal.MockOSLog) OSTrackerFactory(com.onesignal.influence.data.OSTrackerFactory) MockOneSignalDBHelper(com.onesignal.MockOneSignalDBHelper) MockOSTimeImpl(com.onesignal.MockOSTimeImpl) MockSessionManager(com.onesignal.MockSessionManager) MockOSSharedPreferences(com.onesignal.MockOSSharedPreferences) Before(org.junit.Before)

Example 7 with MockOneSignalDBHelper

use of com.onesignal.MockOneSignalDBHelper in project OneSignal-Android-SDK by OneSignal.

the class InAppMessageIntegrationTests method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    ShadowDynamicTimer.shouldScheduleTimers = true;
    time = new MockOSTimeImpl();
    preferences = new MockOSSharedPreferences();
    trackerFactory = new OSTrackerFactory(preferences, new MockOSLog(), time);
    sessionManager = new MockSessionManager(OneSignal_getSessionListener(), trackerFactory, new MockOSLog());
    blankActivityController = Robolectric.buildActivity(BlankActivity.class).create();
    blankActivity = blankActivityController.get();
    dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
    TestHelpers.beforeTestInitAndCleanup();
    // Set remote_params GET response
    setRemoteParamsGetHtmlResponse();
}
Also used : MockOSLog(com.onesignal.MockOSLog) OSTrackerFactory(com.onesignal.influence.data.OSTrackerFactory) MockOneSignalDBHelper(com.onesignal.MockOneSignalDBHelper) MockOSTimeImpl(com.onesignal.MockOSTimeImpl) MockSessionManager(com.onesignal.MockSessionManager) MockOSSharedPreferences(com.onesignal.MockOSSharedPreferences) Before(org.junit.Before)

Example 8 with MockOneSignalDBHelper

use of com.onesignal.MockOneSignalDBHelper in project OneSignal-Android-SDK by OneSignal.

the class SynchronizerIntegrationTests method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    blankActivityController = Robolectric.buildActivity(BlankActivity.class).create();
    blankActivity = blankActivityController.get();
    time = new MockOSTimeImpl();
    trackerFactory = new OSTrackerFactory(new MockOSSharedPreferences(), new MockOSLog(), time);
    sessionManager = new MockSessionManager(OneSignal_getSessionListener(), trackerFactory, new MockOSLog());
    dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
    TestHelpers.setupTestWorkManager(blankActivity);
    cleanUp();
    OneSignal_setTime(time);
}
Also used : MockOSLog(com.onesignal.MockOSLog) OSTrackerFactory(com.onesignal.influence.data.OSTrackerFactory) MockOneSignalDBHelper(com.onesignal.MockOneSignalDBHelper) MockOSTimeImpl(com.onesignal.MockOSTimeImpl) MockSessionManager(com.onesignal.MockSessionManager) MockOSSharedPreferences(com.onesignal.MockOSSharedPreferences) Before(org.junit.Before)

Example 9 with MockOneSignalDBHelper

use of com.onesignal.MockOneSignalDBHelper in project OneSignal-Android-SDK by OneSignal.

the class DatabaseRunner method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    TestHelpers.beforeTestInitAndCleanup();
    outcomeTableProvider = new OSOutcomeTableProvider();
    dbHelper = new MockOneSignalDBHelper(ApplicationProvider.getApplicationContext());
}
Also used : OSOutcomeTableProvider(com.onesignal.outcomes.data.OSOutcomeTableProvider) MockOneSignalDBHelper(com.onesignal.MockOneSignalDBHelper) Before(org.junit.Before)

Aggregations

MockOneSignalDBHelper (com.onesignal.MockOneSignalDBHelper)9 Before (org.junit.Before)9 MockOSTimeImpl (com.onesignal.MockOSTimeImpl)8 MockSessionManager (com.onesignal.MockSessionManager)7 OSTrackerFactory (com.onesignal.influence.data.OSTrackerFactory)7 MockOSSharedPreferences (com.onesignal.MockOSSharedPreferences)6 MockOSLog (com.onesignal.MockOSLog)4 OneSignalPackagePrivateHelper (com.onesignal.OneSignalPackagePrivateHelper)3 MockOneSignalAPIClient (com.onesignal.MockOneSignalAPIClient)2 MockOutcomeEventsController (com.onesignal.MockOutcomeEventsController)2 OSOutcomeEventsFactory (com.onesignal.outcomes.data.OSOutcomeEventsFactory)2 NotificationManager (android.app.NotificationManager)1 ShadowRoboNotificationManager (com.onesignal.ShadowRoboNotificationManager)1 OSOutcomeTableProvider (com.onesignal.outcomes.data.OSOutcomeTableProvider)1