コード例 #1
0
        public void SwitchesCount()
        {
            var scanner  = new ScannerService(context);
            var switches = scanner.GetAllSwitches();

            Assert.AreEqual(context.NetworkEvents.Select(s => s.Switch_Ip).Distinct().Count(), switches.Count());
        }
コード例 #2
0
        public void NUmberOfEventsInOneSwitch()
        {
            var scanner  = new ScannerService(context);
            var switches = scanner.GetAllSwitches();

            var firstSwitch = switches.First();

            Assert.AreEqual(context.NetworkEvents.Where(f => f.Switch_Ip == firstSwitch.Switch_Ip).Select(p => p.Event_Id).Count(), firstSwitch.Events.Count());
        }
コード例 #3
0
        public void SwitchesEmpty()
        {
            context.NetworkEvents.RemoveRange(context.NetworkEvents);
            context.SaveChanges();
            var scanner  = new ScannerService(context);
            var switches = scanner.GetAllSwitches();

            Assert.AreEqual(context.NetworkEvents.Select(s => s.Switch_Ip).Distinct().Count(), switches.Count());
        }
コード例 #4
0
        public void PortPerSwitchCount()
        {
            var scanner  = new ScannerService(context);
            var switches = scanner.GetAllSwitches();

            foreach (var @switch in switches)
            {
                Assert.AreEqual(context.NetworkEvents.Where(f => f.Switch_Ip == @switch.Switch_Ip).Select(p => p.Port_Id).Distinct().Count(), @switch.Ports.Count());
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: orens/Portnox
 static void Main(string[] args)
 {
     var scanner = new ScannerService();
     var result  = scanner.GetAllSwitches();
 }