public TestResponse Invoke(LookupClientOptions lookupClientOptions = null, DnsQueryAndServerOptions useOptions = null, IReadOnlyCollection <NameServer> useServers = null) { var testClient = new TestClient(lookupClientOptions); var servers = useServers ?? new NameServer[] { IPAddress.Loopback }; var queryOptions = useOptions ?? new DnsQueryAndServerOptions(); IDnsQueryResponse response = null; if (ResolverServers != null) { response = ResolverServers(testClient.Client, servers); } else if (ResolverQueryOptions != null) { response = ResolverQueryOptions(testClient.Client, queryOptions); } else if (ResolverServersAndOptions != null) { response = ResolverServersAndOptions(testClient.Client, queryOptions, useServers); } else { response = ResolverSimple(testClient.Client); } return(new TestResponse(testClient, response)); }
public TestResponse InvokeNoDefaults(LookupClientOptions lookupClientOptions, DnsQueryAndServerOptions useOptions, IReadOnlyCollection <NameServer> useServers) { var testClient = new TestClient(lookupClientOptions); IDnsQueryResponse response = null; if (ResolverServers != null) { response = ResolverServers(testClient.Client, useServers); } else if (ResolverQueryOptions != null) { response = ResolverQueryOptions(testClient.Client, useOptions); } else if (ResolverServersAndOptions != null) { response = ResolverServersAndOptions(testClient.Client, useOptions, useServers); } else { response = ResolverSimple(testClient.Client); } return(new TestResponse(testClient, response)); }