Ejemplo n.º 1
0
 public void When_dns_servers_unreachable_should_throw_SocketException()
 {
     var xmppHostsLookup = new XmppHostsLookup();
     var ipAddresses = new []{ IPAddress.Parse("1.1.1.1")}; //assuming there is no dns server at 1.1.1.1
     var logger = new ConsoleOutLogger("XmppHostsLookupTests", LogLevel.All, true, true, true, "yyyy-MM-dd HH:MM:SS");
     Assert.Throws<SocketException>( ()=> xmppHostsLookup.GetXmppHosts(ipAddresses, "host", logger));
 }
Ejemplo n.º 2
0
 public void When_lookup_internal_server_should_get_at_least_one_host()
 {
     //This test assumes a host on the internal network called winxmpp
     var xmppHostsLookup = new XmppHostsLookup();
     var dnsServerLookup = new WmiDnsServerLookup();
     var logger = new ConsoleOutLogger("XmppHostsLookupTests", LogLevel.All, true, true, true, "yyyy-MM-dd HH:MM:SS");
     XmppHost[] xmppHosts = xmppHostsLookup.GetXmppHosts(dnsServerLookup.GetDnsServers(), "winxmpp", logger);
     Assert.NotNull(xmppHosts);
     Assert.InRange(xmppHosts.Length, 1, int.MaxValue);
 }
Ejemplo n.º 3
0
 public void When_lookup_gmail_xmpp_server_should_get_at_least_one_host()
 {
     //This test requires a working internet connection
     var xmppHostsLookup = new XmppHostsLookup();
     var dnsServerLookup = new WmiDnsServerLookup();
     var logger = new ConsoleOutLogger("XmppHostsLookupTests", LogLevel.All, true, true, true, "yyyy-MM-dd HH:MM:SS");
     XmppHost[] xmppHosts = xmppHostsLookup.GetXmppHosts(dnsServerLookup.GetDnsServers(), "gmail.com", logger);
     Assert.NotNull(xmppHosts);
     Assert.InRange(xmppHosts.Length, 1, int.MaxValue);
 }