public void NewRequestPool_WhenStarted_ShouldStartUpDefinedNumberOfClients() { var clientNetworkLayer = new ClientTestNetworkLinkLayer(); var transportLayer = new ClientTestTransportLayer(clientNetworkLayer); var requestPool = new RequestPool <ClientControlFrame>(transportLayer, 4); requestPool.Start(); Assert.AreEqual(requestPool.InitialClientSize, requestPool.ActiveClients); requestPool.Stop(); }
public void NewRequestPool_WhenStarted_ShouldSendControlMessages() { var clientNetworkLayer = new ClientTestNetworkLinkLayer(); var transportLayer = new ClientTestTransportLayer(clientNetworkLayer); var requestPool = new RequestPool <ClientControlFrame>(transportLayer); requestPool.Start(); requestPool.Stop(); var frames = clientNetworkLayer.SentBytes.Select(this.clientFrameEncoder.Decode).ToList(); Assert.IsTrue(frames.Any()); Assert.IsTrue(frames.OfType <ClientControlFrame>().Any()); }