Ejemplo n.º 1
0
        public async Task Insert()
        {
            var list = new RedisList <int>(GlobalSettings.Default, "listkey4");
            await list.Delete();

            await list.RightPush(new[] { 1, 2, 3, 4, 5 });

            (await list.Range()).Is(1, 2, 3, 4, 5);

            (await list.InsertBefore(4, 1000)).Is(6);
            (await list.Range()).Is(1, 2, 3, 1000, 4, 5);

            (await list.InsertAfter(4, 2000)).Is(7);
            (await list.Range()).Is(1, 2, 3, 1000, 4, 2000, 5);
        }
Ejemplo n.º 2
0
        public async Task Insert()
        {
            var list = new RedisList<int>(GlobalSettings.Default, "listkey4");
            await list.Delete();

            await list.RightPush(new[] { 1, 2, 3, 4, 5 });
            (await list.Range()).Is(1, 2, 3, 4, 5);

            (await list.InsertBefore(4, 1000)).Is(6);
            (await list.Range()).Is(1, 2, 3, 1000, 4, 5);

            (await list.InsertAfter(4, 2000)).Is(7);
            (await list.Range()).Is(1, 2, 3, 1000, 4, 2000, 5);
        }