public void Run() { UserActions action; do { action = DetermineAction(); PerformAction(action); } while (!(action == UserActions.Exit)); file.Save(list, input); }
public void SecondSaveShouldDefaultToSameFilePathAsFirst() { TestStorage saveSensor = new TestStorage(); TaskListFile file = new TaskListFile(saveSensor); file.Save(new TaskList(), new TestInputParser(new List <string> { "TestFileName" })); saveSensor.Clear(); file.Save(new TaskList(), new TestInputParser(new List <string> { })); Assert.AreEqual("TestFileName", saveSensor.SavedFile, string.Format("Saved file name should be TestFileName, not {0}", saveSensor.SavedFile)); }
public void SaveAfterLoadShouldDefaultToFileThatWasLoaded() { TestStorage saveSensor = new TestStorage(); TaskListFile file = new TaskListFile(saveSensor); file.Load("LoadTestFile"); file.Save(new TaskList(), new TestInputParser(new List <string> { })); //null saveSensor.Clear(); file.Save(new TaskList(), new TestInputParser(new List <string> { })); //string.Empty Assert.AreEqual("LoadTestFile", saveSensor.SavedFile, string.Format("Saved file name should be LoadTestFile, not {0}", saveSensor.SavedFile)); }
public void SaveWithFilePathShouldSaveData() { TestStorage saveSensor = new TestStorage(); TaskListFile file = new TaskListFile(saveSensor); file.Save(new TaskList(), new TestInputParser(new List <string> { "TestFileName" })); Assert.AreEqual("TestFileName", saveSensor.SavedFile, string.Format("Saved file name should be TestFileName, not {0}", saveSensor.SavedFile)); }