public void TestClear() { DynamicList <int> expected = new DynamicList <int>() { }; DynamicList <int> actual = new DynamicList <int>() { 1, 2, 3, 4 }; actual.Clear(); Assert.IsTrue(expected.Equals(actual)); }
public void TestRemoveByValue() { DynamicList <int> expected = new DynamicList <int>() { 1, 2, 4 }; DynamicList <int> actual = new DynamicList <int>() { 1, 2, 3, 4 }; actual.Remove(3); Assert.IsTrue(expected.Equals(actual)); }
public void TestForeach() { DynamicList <int> expected = new DynamicList <int>() { 1, 4, 9, 16 }; DynamicList <int> temp = new DynamicList <int>() { 1, 2, 3, 4 }; DynamicList <int> actual = new DynamicList <int>() { }; foreach (int el in temp) { actual.Add(el * el); } Assert.IsTrue(expected.Equals(actual)); }