public void Emit_LessThanBatchLimitOfEvents_DoesNotEmitBatch()
        {
            var batchLimit = 50;
            var client     = Mock.Create <IRedisClient>();

            var period = TimeSpan.FromSeconds(10);
            var sut    = new TestableRedisListSink(client, period, batchLimit);
            var ev     = CreateLogItem();

            sut.Emit(ev);
            Assert.False(sut.CalledEmit);
        }
        public void Emit_BatchLimitOfEvents_EmitsBatch()
        {
            var batchLimit = 50;
            var client     = Mock.Create <IRedisClient>();

            var period = TimeSpan.FromSeconds(10);
            var sut    = new TestableRedisListSink(client, period, batchLimit);
            var ev     = CreateLogItem();

            for (var i = 0; i <= batchLimit; i++)
            {
                sut.Emit(ev);
            }
            SpinWait.SpinUntil(() => sut.CalledEmit, TimeSpan.FromSeconds(5));
            Assert.True(sut.CalledEmit);
        }