コード例 #1
0
 public void ConnectionThrowsIfAuthenticationDoesNotPass()
 {
     using (var server = new TestableFailingTcpServer())
     {
         Assert.Throws <KException>(() => new c("localhost", server.TestPort));
     }
 }
コード例 #2
0
        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);
            }
        }