Esempio n. 1
0
 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());
 }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
 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());
 }
Esempio n. 4
0
 public void AddOne([NotNull] string what)
 {
     var h = new History();
     h.Add(what);
     Assert.AreEqual(what, h.GetNext());
 }