Beispiel #1
0
    public void TestSortSet()
    {
        var cacheKey = nameof(TestSortSet).ToLower();

        _redisProvider.ZAdd(cacheKey, new Dictionary <long, double> {
            { 1, DateTime.Now.GetTotalMilliseconds() }
        });
        dynamic returnReulst = _redisProvider.ZRange <long>(cacheKey, 0, 0);

        _output.WriteLine(returnReulst[0].ToString());
        Assert.NotNull(returnReulst);

        // 返回有序集合中指定成员的索引
        returnReulst = _redisProvider.ZRank <long>(cacheKey, 1);
        _output.WriteLine(returnReulst.ToString());
        Assert.True(returnReulst >= 0);
    }