public void SaveAndLoad() { history.AddActivity("saved"); history.AddActivity("saved2"); StringBuilder sb = new StringBuilder(); StringWriter writer = new StringWriter(sb); history.Save(writer); history = new ActivitiesHistory(); history.Load(new StringReader(sb.ToString())); Assert.AreEqual(new string[] { "saved2", "saved" }, history.Activities); }
public void Load() { File.CreateText("HistoryTest-Load.txt").Close(); Assert.IsTrue(history.Load("HistoryTest-Load.txt")); }