public void InitializeRuntime () {
Poker host = new Poker ();
host.CallInitializeDescription ();
- EndpointAddress address = new EndpointAddress ("http://localhost:8090/");
+ var port = NetworkHelpers.FindFreePort ();
+ EndpointAddress address = new EndpointAddress ("http://localhost:" + port + "/");
ContractDescription contract = ContractDescription.GetContract (typeof (IMyContract));
ServiceEndpoint endpoint = new ServiceEndpoint (contract, new BasicHttpBinding (), address);
endpoint.ListenUri = address.Uri;
public void AddServiceEndpoint_Directly ()
{
var host = new ServiceHost (typeof (DummyService));
- var address = new EndpointAddress ("http://localhost:30158");
+ var port = NetworkHelpers.FindFreePort ();
+ var address = new EndpointAddress ("http://localhost:" + port);
var binding = new BasicHttpBinding ();
var contract = ContractDescription.GetContract (typeof (IDummyService));
host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, address));
public void AddServiceEndpoint_Directly_NullBinding ()
{
var host = new ServiceHost (typeof (DummyService));
- var address = new EndpointAddress ("http://localhost:30158");
+ var port = NetworkHelpers.FindFreePort ();
+ var address = new EndpointAddress ("http://localhost:" + port);
var contract = ContractDescription.GetContract (typeof (IDummyService));
host.AddServiceEndpoint (new ServiceEndpoint (contract, null, address));
}
public void AddServiceEndpoint_Directly_ContractMismatch ()
{
var host = new ServiceHost (typeof (DummyService));
- var address = new EndpointAddress ("http://localhost:30158");
+ var port = NetworkHelpers.FindFreePort ();
+ var address = new EndpointAddress ("http://localhost:" + port);
var binding = new BasicHttpBinding ();
var contract = ContractDescription.GetContract (typeof (INotImplementedService));
host.AddServiceEndpoint (new ServiceEndpoint (contract, binding, address));