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);
 }
예제 #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);
        }
예제 #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);
 }
예제 #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);
        }