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 }); }
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 }); }
private async Task ReturnsExpected(MockRedisDatabase db, string key, byte[] expected) { byte[] locations = await db.StringGetAsync(key); locations.Should().Equal(expected); }