public SimpleServerTests() { var l = new TcpListener(IPAddress.Loopback, 0); l.Start(); _freePort = (ushort) ((IPEndPoint) l.LocalEndpoint).Port; l.Stop(); _urlBase = "http://127.0.0.1:" + _freePort + "/"; }