예제 #1
0
        public void TestInterfacesRegex()
        {
            RegexHelper helper           = new RegexHelper();
            var         interfacesString = TestTextLoader.LoadText("Interfaces1.txt");
            var         interfaces       = helper.GetInterfaces(interfacesString).ToArray();

            Assert.IsTrue(interfaces.Count() == 1);
            Assert.IsTrue(interfaces[0].Description == "Ralink RT3050 802.11b/g/n WiFi Adapter");
            Assert.IsTrue(interfaces[0].Guid.ToString() == "b2e5dcaa-dba5-4663-ba87-d6519e2fab4c");
        }
예제 #2
0
        public void TestavAlibleNetworksRegex()
        {
            RegexHelper helper = new RegexHelper();
            var         avalibleNetworksString = TestTextLoader.LoadText("Networks.txt");
            var         avalibleNetworks       = helper.GetAvalibleNetworks(avalibleNetworksString).ToArray();

            Assert.IsTrue(avalibleNetworks.Count() == 3);
            Assert.IsTrue(avalibleNetworks[0].Name == "Network1");
            Assert.IsTrue(avalibleNetworks[1].EncryptionType == CipherAlgorithm.None);
            Assert.IsTrue(avalibleNetworks[1].BssIds.Count == 2);


            Assert.IsTrue(avalibleNetworks[2].AuthenticationType == AuthAlgorithm.Open);
            Assert.IsTrue(avalibleNetworks[2].NetworkType == BssType.Infrastructure);

            var bssId3 = avalibleNetworks[2].BssIds[0];

            Assert.IsTrue(bssId3.SignalStreich == 42);
            Assert.IsTrue(bssId3.RadioType == "802.11g");
            Assert.IsTrue(bssId3.Channel == 8);
            Assert.IsTrue(bssId3.Rates == "1 2 5.5 11");
            Assert.IsTrue(bssId3.OtherRates == "6 9 12 18 24 36 48 54");
        }