public void ConnectionThrowsIfAuthenticationDoesNotPass() { using (var server = new TestableFailingTcpServer()) { Assert.Throws <KException>(() => new c("localhost", server.TestPort)); } }
public void ConnectionThrowsSerialisableExpectionIfAuthenticationDoesNotPass() { KException error = null; c connection = null; using (var server = new TestableFailingTcpServer()) { try { connection = new c("localhost", server.TestPort); } catch (KException ex) { error = TestSerialisationHelper.SerialiseAndDeserialiseException(ex); } Assert.IsNull(connection); Assert.IsNotNull(error); } }