public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnTimer()
 {
     var pbs = new InMemoryPeriodicBatchingSink(2, TinyWait, TimeSpan.Zero);
     var evt = Some.InformationEvent();
     pbs.Emit(evt);
     Thread.Sleep(TinyWait + TinyWait);
     pbs.Stop();
     Assert.AreEqual(1, pbs.Batches.Count);
     Assert.IsFalse(pbs.WasCalledAfterDisposal);
 }
 public void WhenAnEventIsEnqueuedItIsWrittenToABatch_FlushWhileRunning()
 {
     var pbs = new InMemoryPeriodicBatchingSink(2, MicroWait, TinyWait + TinyWait);
     var evt = Some.LogEvent();
     pbs.Emit(evt);
     Thread.Sleep(TinyWait);
     pbs.Dispose();
     Assert.AreEqual(1, pbs.Batches.Count);
     Assert.IsFalse(pbs.WasCalledAfterDisposal);
 }
Exemple #3
0
        public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnTimer()
        {
            var pbs = new InMemoryPeriodicBatchingSink(2, TinyWait, TimeSpan.Zero);
            var evt = Some.InformationEvent();

            pbs.Emit(evt);
            Thread.Sleep(TinyWait + TinyWait);
            pbs.Stop();
            Assert.Equal(1, pbs.Batches.Count);
            Assert.False(pbs.WasCalledAfterDisposal);
        }
Exemple #4
0
        public void WhenAnEventIsEnqueuedItIsWrittenToABatch_FlushWhileRunning()
        {
            var pbs = new InMemoryPeriodicBatchingSink(2, MicroWait, TinyWait + TinyWait);
            var evt = Some.InformationEvent();

            pbs.Emit(evt);
            Thread.Sleep(TinyWait);
            pbs.Dispose();
            Assert.Equal(1, pbs.Batches.Count);
            Assert.False(pbs.WasCalledAfterDisposal);
        }
 public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnFlush()
 {
     var pbs = new InMemoryPeriodicBatchingSink(2, TinyWait, TimeSpan.Zero);
     var evt = Some.InformationEvent();
     pbs.Emit(evt);
     pbs.Dispose();
     Assert.AreEqual(1, pbs.Batches.Count);
     Assert.AreEqual(1, pbs.Batches[0].Count);
     Assert.AreSame(evt, pbs.Batches[0][0]);
     Assert.IsFalse(pbs.WasCalledAfterDisposal);
 }
Exemple #6
0
        public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnFlush()
        {
            var pbs = new InMemoryPeriodicBatchingSink(2, TinyWait, TimeSpan.Zero);
            var evt = Some.InformationEvent();

            pbs.Emit(evt);
            pbs.Dispose();
            Assert.Equal(1, pbs.Batches.Count);
            Assert.Equal(1, pbs.Batches[0].Count);
            Assert.Same(evt, pbs.Batches[0][0]);
            Assert.False(pbs.WasCalledAfterDisposal);
        }