public DiscoveryTestBuilder WithDns(IDns dnsClient = default, bool mock = false, IPeerSettings peerSettings = default) { _dnsClient = dnsClient == default(IDns) && mock == false ? Substitute.For <IDns>() : DiscoveryHelper.MockDnsClient(_peerSettings = _peerSettings == null && peerSettings == default(IPeerSettings) ? PeerSettingsHelper.TestPeerSettings() : peerSettings); return(this); }