public async Task Test_SelectWithSubscriptionClient() { Exception thrownException = null; var dut = new AsyncRedisSubscriptionClient(); try { await dut.Connect(LocalHostDefaultPort.AsConnectionSettings()); await dut.Select(1); } catch (Exception ex) { thrownException = ex; } Assert.IsNull(thrownException); }
public async Task TestWrongDbIndex_SelectWithSubscriptionClientThrowsException() { Exception thrownException = null; var dut = new AsyncRedisSubscriptionClient(); try { await dut.Connect(LocalHostDefaultPort.AsConnectionSettings()); await dut.Select(int.MaxValue); } catch (Exception ex) { thrownException = ex; } Assert.IsNotNull(thrownException); Assert.IsInstanceOfType(thrownException, typeof(RedisException)); }
public async Task TestCallingAfterDispose_SubscriptionClientThrowsException() { Exception thrownException = null; var dut = new AsyncRedisSubscriptionClient(); await dut.Connect(LocalHostDefaultPort.AsConnectionSettings()); dut.Dispose(); try { await dut.Select(1); } catch (Exception ex) { thrownException = ex; } Assert.IsNotNull(thrownException); Assert.IsInstanceOfType(thrownException, typeof(InvalidOperationException)); }