コード例 #1
0
        public void Emit_ValidLogEvents_SendsEventToServer()
        {
            var db = GetDb();
            var ev = CreateLogItem();

            var sut = new RedisListLPushSink(Client(), TimeSpan.FromMilliseconds(1));

            sut.Emit(ev);
            WaitForBatchToComplete();
            var value = db.ListRightPop(key);

            Assert.True(value.HasValue);
        }
コード例 #2
0
        public void Emit_ValidLogEvents_ContainsEvent()
        {
            var db = GetDb();
            var ev = CreateLogItem();

            var sut = new RedisListLPushSink(Client(), TimeSpan.FromMilliseconds(1));

            sut.Emit(ev);
            WaitForBatchToComplete();
            var length = db.ListLength(key);
            var list   = db.ListRange(key, 0, length);

            Assert.True(list.Length == 1);
        }
コード例 #3
0
        public void Emit_100ValidEvents_ContainsEvent()
        {
            var db  = GetDb();
            var sut = new RedisListLPushSink(Client(), TimeSpan.FromMilliseconds(1));

            Enumerable.Range(0, 100).ToList().ForEach(i =>
            {
                var ev = CreateLogItem();
                sut.Emit(ev);
            });

            WaitForBatchToComplete(100);
            var length = db.ListLength(key);
            var list   = db.ListRange(key, 0, length);

            Assert.True(list.Length == 100);
        }