public async Task Cleanup() { try { var dut = new AsyncRedisClient(); await dut.Connect(LocalHostDefaultPort.AsConnectionSettings()); await dut.Select(0); await dut.Del(Key); await dut.Del(Key2); await dut.Select(7); await dut.Del(Key); await dut.Del(Key2); } catch (Exception ex) { Console.WriteLine($"Error during cleanup: {ex}"); throw; } }
public async Task Cleanup() { var dut = new AsyncRedisClient(); await dut.Connect(LocalHostDefaultPort.AsConnectionSettings()); await dut.Del(ListKey); }
public static void Main() { var client = new AsyncRedisClient(); var connectionSettings = new ConnectionSettings("127.0.0.1", 6379); FailIfException(async() => { Console.WriteLine($"Trying to connect to {connectionSettings.Address}:{connectionSettings.Port}..."); await client.Connect(connectionSettings); Pass(); }).GetAwaiter().GetResult(); FailIfException(async() => { Console.WriteLine("Trying simple write..."); await client.Set(Key, Value); Pass(); }).GetAwaiter().GetResult(); FailIfException(async() => { Console.WriteLine("Trying simple read..."); var result = await client.Get(Key); if (result == Value) { Pass(); } else { Fail("Read incorrect value from the server"); } }).GetAwaiter().GetResult(); FailIfException(async() => { Console.WriteLine("Trying DbSize..."); var result = await client.DbSize(); if (result == 1) { Pass(); } else { Fail("Read incorrect db size from the server"); } }).GetAwaiter().GetResult(); FailIfException(async() => { Console.WriteLine("Trying delete..."); await client.Del(Key); Pass(); }).GetAwaiter().GetResult(); }
public async Task Cleanup() { try { var dut = new AsyncRedisClient(); await dut.Connect(LocalHostDefaultPort.AsConnectionSettings()); await dut.Select(0); _keys.ForEach(k => dut.Del(k).GetAwaiter().GetResult()); } catch (Exception ex) { Console.WriteLine($"Error during cleanup: {ex}"); throw; } }