using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

using RedisStudyModel;

using StackExchange;
using StackExchange.Redis;

using RedisStuy;

namespace RedisStudyTest
{
    public class RedisSortSetStudyTest : IDisposable
    {
        private IDatabase redisDatabase = null;
        private RedisSortSetStudy sortSetStudy = null;
        private List<Student> students;

        /// <summary>
        /// 构造
        /// </summary>
        public RedisSortSetStudyTest()
        {
            redisDatabase = RedisHelper.GetRedisDatabase();
            sortSetStudy = new RedisSortSetStudy();
            students = new List<Student>()
            {
                new Student()
                {
                    Id = 1001,
                    Name = "王高峰",
                    Age = 11
                },
                new Student()
                {
                    Id = 1002,
                    Name = "王高峰2",
                    Age = 22
                },
                new Student()
                {
                    Id = 1003,
                    Name = "王高峰3",
                    Age = 33
                },
                new Student()
                {
                    Id = 1004,
                    Name = "王高峰4",
                    Age = 44
                },
                new Student()
                {
                    Id = 1005,
                    Name = "王高峰5",
                    Age = 55
                },
            };
        }

        /// <summary>
        /// 清理
        /// </summary>
        public void Dispose()
        {
            redisDatabase.KeyDelete("student:age:rank");
        }
    }
}