public void MonitorManager_PingMonitors_Should_Leave_Some_HistoryData() { //Arrange int monitorAmount = 5; MonitorManager manager = new MonitorManager(); List <Monitor> monitors = HelperMethods.GenerateMonitorList(monitorAmount); //Act manager.Initialize(); manager.AddMany(monitors); manager.SaveMonitors(); manager.PingMonitors(); //Assert Assert.IsTrue(File.Exists("Data/" + DateTime.Now.ToShortDateString() + ".xml")); //Bad check, come up with something else! }
public void MonitorManager_Save_And_Load_Monitors_And_Save_And_Load_PluginSettings() { //Arrange int monitorAmount = 5; //We make a temp file name, to be sure we are testing against the right //file and not one from a previous test MonitorManager manager = new MonitorManager(); List <Monitor> monitors = HelperMethods.GenerateMonitorList(monitorAmount); monitors[0].Plugins[0].Enabled = true; //Act manager.Initialize(); manager.AddMany(monitors); manager.SaveMonitors(); manager.ClearMonitorList(); manager.LoadMonitors(); //Assert Assert.IsTrue(monitors[0].Plugins[0].Enabled == true); Assert.IsTrue(monitors[0].Plugins[1].Enabled == false); }
public static void FillMonitorList(MonitorManager monitorManager) { monitorManager.AddMany(GenerateMonitorList()); }