Ejemplo n.º 1
0
        public async Task StringSetBitMultipleByteResponse()
        {
            const string key = "TestKey";

            var db = new MockRedisDatabase(SystemClock.Instance);
            await db.StringSetBitAsync(key, 8, true);

            await ReturnsExpected(db, key, new byte[] { 0, 0x80 });
        }
Ejemplo n.º 2
0
        public async Task MultipleStringSetBit()
        {
            const string key = "TestKey";

            var db = new MockRedisDatabase(SystemClock.Instance);

            db.StringSetBitAsync(key, 0, true).GetAwaiter().GetResult();
            await ReturnsExpected(db, key, new byte[] { 0x80 });

            db.StringSetBitAsync(key, 1, true).GetAwaiter().GetResult();
            await ReturnsExpected(db, key, new byte[] { 0xC0 });

            db.StringSetBitAsync(key, 0, false).GetAwaiter().GetResult();
            await ReturnsExpected(db, key, new byte[] { 0x40 });
        }
Ejemplo n.º 3
0
        private async Task ReturnsExpected(MockRedisDatabase db, string key, byte[] expected)
        {
            byte[] locations = await db.StringGetAsync(key);

            locations.Should().Equal(expected);
        }