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 { [Trait("RedisSortSet", "All")] public class RedisSortSetStudyTest : IDisposable { private IDatabase redisDatabase = null; private RedisSortSetStudy sortSetStudy = null; private List students; /// /// 构造 /// public RedisSortSetStudyTest() { redisDatabase = RedisHelper.GetRedisDatabase(); sortSetStudy = new RedisSortSetStudy(); students = new List() { 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 }, }; } /// /// 清理 /// public void Dispose() { redisDatabase.KeyDelete("student:age:rank"); } } }