Exemple #1
0
        public async Task ShouldAddEventToRedisCacheInLocation()
        {
            // Arrange
            string     UDID      = _baseTest.Fixture.Create <string>();
            SelectFunc funcType  = SelectFunc.InLocation;
            string     objkeyold = JsonConvert.SerializeObject(new DeviceNotificationKey()
            {
                FuncType = SelectFunc.OutOfLocation,
                Udid     = UDID,
            });
            await cache.RedisCache.StringSetAsync(objkeyold, UDID);

            // Act
            await _notificationSender.SendAlertInOutlocationPrepareByExpirationTime(funcType, UDID);

            string objkey = JsonConvert.SerializeObject(new DeviceNotificationKey()
            {
                FuncType = SelectFunc.InLocation,
                Udid     = UDID,
            });

            //Assert
            string result = await cache.RedisCache.StringGetAsync(objkey);

            string resultOld = await cache.RedisCache.StringGetAsync(objkeyold);

            Assert.Null(resultOld);
            Assert.NotNull(result);
        }