public void ShouldCountTheNumberOfElementsForTwoElement() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); int result = list.Count(); Assert.AreEqual(2, result); }
public void ShouldIncreaseListLengthForInsert() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Insert(1, 7); int result = list.IndexOf(7); Assert.AreEqual(1, result); }
public void ShouldInsertNewElementInList() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Add(3); list.Insert(2, 7); int result = list.IndexOf(7); Assert.AreEqual(2, result); }
public void ShouldRemoveElementAtIndexOneInList() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Add(3); list.Insert(2, 7); list.RemoveAt(1); int result = list.IndexOf(7); Assert.AreEqual(1, result); }
public void ShouldCountTheNumberOfElementsForOneStringElement() { VectorClass<string> list = new VectorClass<string>(); list.Add("something"); int result = list.Count(); Assert.AreEqual(1, result); }
public void ShouldReturnIndexForElementTwo() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Add(3); int result = list.IndexOf(2); Assert.AreEqual(1, result); }
public void ShouldTestIfListContainsNumberTwo() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Clear(); bool result = list.Contains(2); Assert.IsTrue(result); }
public void ShouldTestIfClearWorks() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Clear(); int result = list.Count(); Assert.AreEqual(0, result); }
public void ShouldTestIEnumerable() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Add(3); list.Insert(2, 7); list.Remove(2); IEnumerator<int> enumerator = list.GetEnumerator(); bool b = enumerator.MoveNext(); int result = enumerator.Current; Assert.AreEqual(1, result); }
public void ShouldTestCopyToIfAdsValuesToArrayStartingFromSecondElement() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Add(3); int[] toAdd = new int[2]; list.CopyTo(toAdd, 1); Assert.AreEqual(3, toAdd[1]); }
public void ShouldTestCopyToIfAdsValuesToArray() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); int[] toAdd = new int[2]; list.CopyTo(toAdd, 0); Assert.AreEqual(1, toAdd[0]); }
public void ShouldReturnMinusOneIfElementIsNotContained() { VectorClass<int> list = new VectorClass<int>(); list.Add(1); list.Add(2); list.Add(3); int result = list.IndexOf(4); Assert.AreEqual(-1, result); }