public async Task ConnectToUnknownHost_ThrowsException() { Exception thrownException = null; var underTest = new AsyncRedisClient(); try { await underTest.Connect(UnknownHost.AsConnectionSettings()); } catch (Exception ex) { thrownException = ex; } thrownException.Should().NotBeNull().And.BeAssignableTo <SocketException>(); }
public async Task TestUnknownHost_ConnectWithSubscriptionClientThrowsException() { Exception thrownException = null; var dut = new AsyncRedisSubscriptionClient(); try { await dut.Connect(UnknownHost.AsConnectionSettings()); } catch (Exception ex) { thrownException = ex; } Assert.IsNotNull(thrownException); Assert.IsInstanceOfType(thrownException, typeof(SocketException)); }