public void GenericTest_10points() { GenericList <string> stringList = new GenericList <string>(); stringList.Add("pero"); Assert.AreEqual("pero", stringList.GetElement(0)); Assert.AreEqual(1, stringList.Count); Assert.AreEqual(true, stringList.Contains("pero")); stringList.Remove("pero"); Assert.AreEqual(false, stringList.Contains("pero")); Assert.AreEqual(0, stringList.Count); GenericList <bool> boolList = new GenericList <bool>(); boolList.Add(false); boolList.Add(true); boolList.Add(true); Assert.AreEqual(false, boolList.GetElement(0)); Assert.AreEqual(true, boolList.GetElement(1)); Assert.AreEqual(3, boolList.Count); boolList.Remove(false); Assert.AreEqual(false, boolList.Contains(false)); Assert.AreEqual(2, boolList.Count); }
public bool MoveNext() { if ((_index + 1) >= _genericList.Count) { return(false); } _index++; _curent = _genericList.GetElement(_index); return(true); }
public bool MoveNext() { _sp++; if (_sp >= _list.Count) { return false; } _item = _list.GetElement(_sp); return true; }
public bool MoveNext() { listCurrentIndex++; if (listCurrentIndex >= _internalEnumenatorList.Count) { return(false); } else { listValue = _internalEnumenatorList.GetElement(listCurrentIndex); return(true); } }
public GenericListEnumerator(GenericList <T> genericList) { this._genericList = genericList; _current = genericList.GetElement(0); }