public void WebServiceHost3OpenTest() { Type serviceType = typeof(TestService); Uri baseAddress = new Uri(TestService.BaseAddress); using (WebServiceHost3 target = new WebServiceHost3(serviceType, baseAddress)) { target.Open(); Assert.AreEqual(1, target.Description.Endpoints.Count); foreach (ServiceEndpoint endpoint in target.Description.Endpoints) { Assert.AreEqual(typeof(ITestService).FullName, endpoint.Contract.ContractType.FullName); Assert.IsNotNull(endpoint.Behaviors.Find<WebHttpBehavior3>()); } } }
public void WebServiceHost3OpenTest() { Type serviceType = typeof(TestService); Uri baseAddress = new Uri(TestService.BaseAddress); using (WebServiceHost3 target = new WebServiceHost3(serviceType, baseAddress)) { target.Open(); Assert.AreEqual(1, target.Description.Endpoints.Count); foreach (ServiceEndpoint endpoint in target.Description.Endpoints) { Assert.AreEqual(typeof(ITestService).FullName, endpoint.Contract.ContractType.FullName); Assert.IsNotNull(endpoint.Behaviors.Find <WebHttpBehavior3>()); } } }
public void MyTestInitialize() { jQueryServiceHost = new WebServiceHost3(typeof(JQueryWCFService), new Uri(Endpoint)); jQueryServiceHost.Open(); }