示例#1
0
        public void SetDnsSetsAValidDns()
        {
            string newIp = "176.28.51.226";
            string name  = "Local Area Connection";

            DnsHelper.SetDns(newIp, name);

            List <IPAddress> ipAddresses = DnsHelper.GetActiveEthernetIpv4DnsAddresses();

            DnsHelper.RemoveDns(name);

            Assert.IsTrue(ipAddresses.Any(ip => ip.ToString() == newIp));
        }
示例#2
0
        public override void ExecuteOption(OptionReport report)
        {
            string dns  = _databaseAdjustDns.dnsIp;
            string name = _databaseAdjustDns.adapterName;

            DnsHelper.SetDns(dns, name);

            List <IPAddress> addresses = DnsHelper.GetActiveEthernetIpv4DnsAddresses();

            report.Success = addresses.Any(address => address.ToString() == dns);

            return;
        }
示例#3
0
        public void GetActiveEthernetIpv4DnsAddressesReturnsAddresses()
        {
            List <IPAddress> ipAddresses = DnsHelper.GetActiveEthernetIpv4DnsAddresses();

            Assert.AreNotEqual(0, ipAddresses.Count);
        }