public void ClearQueue_Clears_QueuedHits()
        {
            // setup
            int expectedSize = 3;

            latch = new CountdownEvent(1);
            var config = new Dictionary <string, Java.Lang.Object>();

            config.Add("analytics.batchLimit", 5);
            ACPCore.UpdateConfiguration(config);
            ACPCore.TrackAction("action", null);
            ACPCore.TrackAction("action", null);
            ACPCore.TrackAction("action", null);
            // test
            ACPAnalytics.GetQueueSize(new QueueSizeCallback());
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(retrievedQueueSize, Is.EqualTo(expectedSize));
            // test
            expectedSize = 0;
            ACPAnalytics.ClearQueue();
            latch = new CountdownEvent(1);
            ACPAnalytics.GetQueueSize(new QueueSizeCallback());
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(retrievedQueueSize, Is.EqualTo(expectedSize));
        }
Esempio n. 2
0
        //ACPAnalytics

        partial void GetQueueSize(UIButton sender)
        {
            var callback = new Action <nuint>(handleCallback);

            ACPAnalytics.GetQueueSize(callback);
            Console.WriteLine("GetQueueSize: Completed");
        }
Esempio n. 3
0
    //used for testing
    void BatchAnalyticsHits()
    {
        //setup
        latch = new CountdownEvent(1);

        //set batch limit to 5
        Dictionary <string, object> config = new Dictionary <string, object>();

        config.Add("analytics.batchLimit", "5");
        ACPCore.UpdateConfiguration(config);

        Thread.Sleep(1000);

        Dictionary <string, string> contextData = new Dictionary <string, string>();

        contextData.Add("contextdata", "data");
        ACPCore.TrackAction("action", contextData);
        ACPCore.TrackAction("action", contextData);
        ACPCore.TrackAction("action", contextData);

        //get queue size for batches hits
        ACPAnalytics.GetQueueSize(HandleAdobeBatchedGetQueueSizeCallback);
        latch.Wait();

        //cleanup
        latch.Dispose();
        latch = null;
    }
 public TaskCompletionSource <string> GetQueueSize()
 {
     stringOutput = new TaskCompletionSource <string>();
     ACPAnalytics.GetQueueSize(new StringCallback());
     stringOutput.SetResult("");
     return(stringOutput);
 }
Esempio n. 5
0
        public TaskCompletionSource <string> GetQueueSize()
        {
            stringOutput = new TaskCompletionSource <string>();
            var callback = new Action <nuint>(handleCallback);

            ACPAnalytics.GetQueueSize(callback);
            stringOutput.SetResult("");
            return(stringOutput);
        }
        public void ClearQueue_Clears_QueuedHits()
        {
            // setup
            var   latch     = new CountdownEvent(1);
            nuint queueSize = 0;
            var   config    = new NSMutableDictionary <NSString, NSObject>
            {
                ["analytics.batchLimit"] = new NSNumber(5)
            };

            ACPCore.UpdateConfiguration(config);
            ACPCore.TrackAction("action", null);
            ACPCore.TrackAction("action", null);
            ACPCore.TrackAction("action", null);
            // test
            ACPAnalytics.GetQueueSize(callback =>
            {
                queueSize = callback;
                latch.Signal();
            });
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(queueSize, Is.EqualTo(3));
            // test
            ACPAnalytics.ClearQueue();
            latch = new CountdownEvent(1);
            ACPAnalytics.GetQueueSize(callback =>
            {
                queueSize = callback;
                latch.Signal();
            });
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(queueSize, Is.EqualTo(0));
        }
Esempio n. 7
0
 void GetQueueSize()
 {
     Debug.Log("Calling getQueueSize");
     ACPAnalytics.GetQueueSize(HandleAdobeGetQueueSizeCallback);
 }