public void MonitorDataStore_Save_And_Load_Monitor_File() { //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 string tempFilename = "Monitors_" + Guid.NewGuid() + ".xml"; List <Monitor> monitors = HelperMethods.GenerateMonitorList(monitorAmount); List <Monitor> loadedMonitors = null; //Act MonitorDataStore.Save(monitors, tempFilename); loadedMonitors = MonitorDataStore.Load(tempFilename); //Assert Assert.IsTrue(monitors.Count == loadedMonitors.Count); Assert.IsTrue(monitors[3].Id == loadedMonitors[3].Id); //Cleanup File.Delete(tempFilename); }
public void SaveMonitors() { MonitorDataStore.Save(monitors); PluginsDataStore.Save(monitors); }