Example #1
0
        public async System.Threading.Tasks.Task TestAddEnumAsync()
        {
            var hashSet = new RedisHashSet <string, DayOfWeek> (base.Database, SetKey);

            Assert.Empty(hashSet.Values);

            foreach (DayOfWeek item in Enum.GetValues(typeof(DayOfWeek)))
            {
                await hashSet.AsAsync().AddAsync(item.ToString(), item);
            }
            Assert.NotEmpty(hashSet.Values);

            Assert.All(hashSet.Values, t => Assert.IsType <DayOfWeek> (t));
        }
Example #2
0
        public void TestAddEnum()
        {
            var hashSet = new RedisHashSet <string, DayOfWeek> (base.Database, SetKey);

            Assert.Empty(hashSet.Values);

            foreach (DayOfWeek item in Enum.GetValues(typeof(DayOfWeek)))
            {
                hashSet.Add(item.ToString(), item);
            }
            Assert.NotEmpty(hashSet.Values);

            Assert.IsType <DayOfWeek> (hashSet.Values.First());
        }