public void The_TCP_transport_implementation_should_properly_complete_one_client_server_request_response_cycle()
{
new TestSetup(this).Run(x =>
{
var actors = x.EstablishNewClientConnection();
actors.ClientHandler.Send(actors.ClientConnection, Tcp.Write.Create(ByteString.FromString("Captain on the bridge!"), Aye.Instance));
actors.ClientHandler.ExpectMsg(Aye.Instance);
actors.ServerHandler.ExpectMsg<Tcp.Received>().Data.DecodeString(Encoding.ASCII).ShouldBe("Captain on the bridge!");
actors.ServerHandler.Send(actors.ServerConnection, Tcp.Write.Create(ByteString.FromString("For the king!"), Yes.Instance));
actors.ServerHandler.ExpectMsg(Yes.Instance);
actors.ClientHandler.ExpectMsg<Tcp.Received>().Data.DecodeString(Encoding.ASCII).ShouldBe("For the king!");
actors.ServerHandler.Send(actors.ServerConnection, Tcp.Close.Instance);
actors.ServerHandler.ExpectMsg<Tcp.Closed>();
actors.ClientHandler.ExpectMsg<Tcp.PeerClosed>();
VerifyActorTermination(actors.ClientConnection);
VerifyActorTermination(actors.ServerConnection);
});
}