public async Task Can_The_Batch_ResultAsync() { var operate = new RedisBitOperate(ConfigurationOptions.Parse("localhost")); string key = "RB:BatchAsync"; await operate.ClearAsync(key); var positions = new int[] { 5, 6, 7, 8, 9, 10, 11, 12 }; var results = await operate.SetAsync(key, positions, true); Assert.False(results.All(r => r)); results = await operate.SetAsync(key, positions, true); Assert.True(results.All(r => r)); results = await operate.GetAsync(key, positions); Assert.True(results.All(r => r)); await operate.ClearAsync(key); results = await operate.GetAsync(key, positions); Assert.False(results.All(r => r)); operate.Dispose(); }
public async Task NormalTestAsync() { var operate = new RedisBitOperate("localhost"); await operate.SetAsync("RB-NormalTestAsync", 0, true); Assert.True(await operate.GetAsync("RB-NormalTestAsync", 0)); operate.Dispose(); }
public async Task Can_Close_With_New_ConnectionAsync() { var conn = ConnectionMultiplexer.Connect("localhost"); Assert.True(conn.IsConnected); conn.Dispose(); Assert.False(conn.IsConnected); var operate = new RedisBitOperate(conn); await operate.SetAsync("Can_Close_With_New_ConnectionAsync", 2, true); Assert.True(await operate.GetAsync("Can_Close_With_New_ConnectionAsync", 2)); operate.Dispose(); }
public async Task Can_Connection_Has_Not_CloseAsync() { var conn = ConnectionMultiplexer.Connect("localhost"); Assert.True(conn.IsConnected); var operate = new RedisBitOperate(conn); await operate.SetAsync("Can_Connection_Has_Not_CloseAsync", 1, true); Assert.True(await operate.GetAsync("Can_Connection_Has_Not_CloseAsync", 1)); operate.Dispose(); Assert.True(conn.IsConnected); }