public void GetHostNameTest(string uriString, string expectedHostName) { //fails with international tld (.jp, etc.) Uri uri = new Uri(uriString); string hostName = HostHelper.GetHostName(uri); Assert.AreEqual(hostName, expectedHostName); }
public virtual IEnumerable <string> GetAll() { foreach (var config in PubSubConfigurationSection.Configurations.Configs) { var item = (PubSubConfig)config; if (item.Name != HostHelper.GetHostName()) { yield return(item.Value); } } }
public HttpResponseMessage Get(string message = "EventMessage") { IWindsorContainer container = new WindsorContainer(new XmlInterpreter(AppDomain.CurrentDomain.BaseDirectory + "App_Config\\castle.config")); //ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container)); var server = new ServerManager(Constants.HubName, Constants.DefaultServerProvider); server.Publish("Test", new Package { Command = message + "Source: " + HostHelper.GetHostName() }); return(new HttpResponseMessage(System.Net.HttpStatusCode.OK)); }