'L{ClientService.whenConnected} returns a L{Deferred} that fires when a
connection is established.'

def test_whenConnectedLater(self):

    clock = Clock()
    (cq, service) = self.makeReconnector(fireImmediately=False, clock=clock)
    a = service.whenConnected()
    b = service.whenConnected()
    c = service.whenConnected(failAfterFailures=1)
    self.assertNoResult(a)
    self.assertNoResult(b)
    self.assertNoResult(c)
    cq.connectQueue[0].callback(None)
    resultA = self.successResultOf(a)
    resultB = self.successResultOf(b)
    resultC = self.successResultOf(c)
    self.assertIdentical(resultA, resultB)
    self.assertIdentical(resultA, resultC)
    self.assertIdentical(resultA, cq.applicationProtocols[0])
