示例#1
0
 public async Task AddEvent_Iterate_Success(IEventCache cache)
 {
     await cache.Clear();
     await cache.Add( new CachedEvent("url", JObject.FromObject( new { AProperty = "AValue" })));
     await cache.Add( new CachedEvent("url", JObject.FromObject( new { AProperty = "AValue" })));
     Assert.NotNull(await cache.TryTake());
     Assert.NotNull(await cache.TryTake());
     Assert.Null(await cache.TryTake());
 }
示例#2
0
        public async void AddEvent_Iterate_Success(IEventCache cache)
        {
            await cache.Clear();

            await cache.Add(new CachedEvent("url", JObject.FromObject(new { AProperty = "AValue" })));

            await cache.Add(new CachedEvent("url", JObject.FromObject(new { AProperty = "AValue" })));

            Assert.NotNull(await cache.TryTake());
            Assert.NotNull(await cache.TryTake());
            Assert.Null(await cache.TryTake());
        }
示例#3
0
        public async Task AddEvent_AddClearEmpty_Success(IEventCache cache)
        {
            await cache.Add(new CachedEvent("url", JObject.FromObject(new { AProperty = "AValue" })));

            await cache.Clear();

            Assert.Null(await cache.TryTake());
        }
示例#4
0
 public async Task AddEvent_ValidObject_Success(IEventCache cache)
 {
     await cache.Add(new CachedEvent("url", JObject.FromObject(new { AProperty = "AValue" })));
 }
示例#5
0
 public async Task AddEvent_Null_Throws(IEventCache cache)
 {
     await cache.Add(null);
 }
示例#6
0
 public void AddEvent_Null_Throws(IEventCache cache)
 {
     Assert.ThrowsAsync <Keen.Core.KeenException>(() => cache.Add(null));
 }
示例#7
0
 public async Task AddEvent_ValidObject_Success(IEventCache cache)
 {
     await cache.Add(new CachedEvent("url", JObject.FromObject( new { AProperty = "AValue" })));
 }
示例#8
0
 public void AddEvent_Null_Throws(IEventCache cache)
 {
     Assert.ThrowsAsync<Keen.Core.KeenException>(() => cache.Add(null));
 }
示例#9
0
 public async Task AddEvent_Null_Throws(IEventCache cache)
 {
     await cache.Add(null);
 }