public void ConnectionFailed() { Assert.IsFalse(provider.IsRunning); var test = new AsyncTest(); var c = GetNewClientConnection(); c.Connected += test.FailHandler; c.Disconnected += (s, e) => { if (e.Result == ConnectionResult.ConnectionFailed) { test.PassHandler(s, e); } else { test.FailHandler(s, e); } }; c.ConnectAsync(Target, MessageTypes); test.Assert(40000); }