コード例 #1
0
        public void setDHCPTest()
        {
            string nic = "WrongTestNIC";
            int    rtn = Win32_NetAdapConfig_Help.SetDHCP(nic);

            Assert.AreEqual(-1, rtn);
        }
コード例 #2
0
        public void setIPTest()
        {
            string nic = "WrongTestNIC";

            int[] rtn = Win32_NetAdapConfig_Help.SetIP(nic, "", "", "", "");
            Assert.AreEqual(-1, rtn[0]);
            Assert.AreEqual(-1, rtn[1]);
            Assert.AreEqual(-1, rtn[2]);
        }
コード例 #3
0
        public void getIPTest()
        {
            string[] ipAddress = null;
            string[] subnets   = null;
            string[] gateways  = null;
            string[] dnses     = null;

            string nicName = "WrongTestNIC";

            Win32_NetAdapConfig_Help.GetIP(nicName, out ipAddress, out subnets, out gateways, out dnses);

            Assert.AreEqual(null, ipAddress);
            Assert.AreEqual(null, subnets);
            Assert.AreEqual(null, gateways);
            Assert.AreEqual(null, dnses);
        }
コード例 #4
0
        public void getNICsTest()
        {
            ArrayList nicList = Win32_NetAdapConfig_Help.getNetworkCards();

            Assert.Greater(nicList.Count, 0);
        }