示例#1
0
        public void testBatchEventMaxLimit()
        {
            var mParticle  = new MockMParticle(new Configuration("apikey", "apiSecret"));
            var eventQueue = new UploadQueue((IMParticle)mParticle);

            for (int i = 0; i < 200; i++)
            {
                var e = new CustomEvent(i + "");
                eventQueue.AddEvent(e);
            }
            eventQueue.ForceUpload(false);
            Assert.Single(mParticle.uploadedBatches);
            Assert.Equal(100, mParticle.uploadedBatches[0].Events.Count);

            List <object> a = new List <object>();

            a.Add(1);
        }
示例#2
0
        public void UploadsEventsInOrder()
        {
            var mParticle  = new MockMParticle(new Configuration("apikey", "apiSecret"));
            var eventQueue = new UploadQueue((IMParticle)mParticle);

            for (int i = 1; i < 201; i++)
            {
                var e = new CustomEvent(i + "");
                eventQueue.AddEvent(e);
            }
            eventQueue.ForceUpload(false);
            Assert.Single(mParticle.uploadedBatches);
            Assert.Equal(100, mParticle.uploadedBatches[0].Events.Count);
            foreach (BaseEvent e in mParticle.uploadedBatches[0].Events)
            {
                var eventNameNum = Int32.Parse(((CustomEvent)e).EventName);
                Assert.True(eventNameNum <= 100 && eventNameNum > 0);
            }
        }