public void AddTwo([NotNull] string what1, [NotNull] string what2) { var h = new History(); h.Add(what1); h.Add(what2); Assert.AreEqual(what2, h.GetNext()); Assert.AreEqual(what1, h.GetNext()); }
public void GetNext() { var h = new History(); h.Add("first"); h.Add("second"); h.Add("third"); Assert.AreEqual("third", h.GetNext()); Assert.AreEqual("second", h.GetNext()); Assert.AreEqual("first", h.GetNext()); Assert.AreEqual("third", h.GetNext()); }
public void Reset() { var h = new History(); h.Add("first"); h.Add("second"); h.Add("third"); Assert.AreEqual("third", h.GetNext()); Assert.AreEqual("second", h.GetNext()); h.Reset(); Assert.Null(h.GetPrevious()); Assert.AreEqual("third", h.GetNext()); }
public void AddOne([NotNull] string what) { var h = new History(); h.Add(what); Assert.AreEqual(what, h.GetNext()); }