public void TestHistoryValidValues() { History hist = new History(); hist.AddItem("http://www.google.de/"); Assert.AreEqual(1, hist.VisitList.Count); Assert.AreEqual("http://www.google.de/", hist.VisitList.ElementAt(0).Value); }
public void TestHistoryInvalidUrl() { History hist = new History(); hist.AddItem("http://www.google.d/"); }
private HistoryHandler() { this._Serializer = new XmlSerialiser<History>(); this._History = new History(); }
private HistoryHandler(String filePath) { this._Serializer = new XmlSerialiser<History>(filePath); this._History = new History(); }
public void DisplayHistory(History history) { this.historyTreeView.Nodes.Clear(); HashSet<String> coll = new HashSet<String>(); foreach (DateTime t in history.VisitList.Keys) { String item = String.Format("{0}-{1}-{2}", t.Year.ToString(), t.Month.ToString(), t.Day.ToString()); coll.Add(item); } foreach (String str in coll) { this.historyTreeView.Nodes.Add(str); } foreach (KeyValuePair<DateTime, String> t in history.VisitList) { String item = String.Format("{0}-{1}-{2}", t.Key.Year.ToString(), t.Key.Month.ToString(), t.Key.Day.ToString()); foreach (TreeNode tn in historyTreeView.Nodes) { if (tn.Text.Equals(item)) { tn.Nodes.Add(t.Value); } } } }