AdjustTest.Pcl.TestActivityHandler.TestTimer C# (CSharp) Method

TestTimer() public method

public TestTimer ( ) : void
return void
        public void TestTimer()
        {
            LogConfig.SetupLogging(logDelegate: msg => System.Diagnostics.Debug.WriteLine(msg),
                logLevel: null);

            AdjustFactory.SetTimerInterval(new TimeSpan(0,0,0,0,4000));
            AdjustFactory.SetTimerStart(new TimeSpan(0,0,0,0,0));

            // create the config to start the session
            AdjustConfig config = new AdjustConfig(appToken: "123456789012", environment: AdjustConfig.EnvironmentSandbox);

            // start activity handler with config
            ActivityHandler activityHandler = GetActivityHandler(config);

            DeviceUtil.Sleep(2000);

            // test init values
            InitTests();

            // test first session start
            CheckFirstSession();

            // wait enough to fire the first cycle
            DeviceUtil.Sleep(4000);
            CheckTimerIsFired(true);

            // end subsession to stop timer
            activityHandler.TrackSubsessionEnd();

            // wait enough for a new cycle
            DeviceUtil.Sleep(6000);

            activityHandler.TrackSubsessionStart();

            DeviceUtil.Sleep(1000);

            CheckTimerIsFired(false);
        }