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()); }
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()); }
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()); }
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()); } }
static void Main(string[] args) { var scanner = new ScannerService(); var result = scanner.GetAllSwitches(); }