public void GetElementThrowTest() { var list = new VSArray <int>(new[] { 1, 2, 3 }); Assert.Throws(typeof(ArgumentOutOfRangeException), () => list.GetElement(-1)); Assert.Throws(typeof(ArgumentOutOfRangeException), () => list.GetElement(8)); }
public void SetElementTest() { var list = new VSArray <int>(new[] { 1, 2, 3, 4, 5, 6 }); list.SetElement(0, 10); Assert.That(list.GetElement(0), Is.EqualTo(10)); list.SetElement(3, 10); Assert.That(list.GetElement(3), Is.EqualTo(10)); }
public void AddElementTest() { var list = new VSArray <char>(new[] { 'a', 'b', 'c', 'd', 'e' }); Assert.That(list.GetElementCount(), Is.EqualTo(5)); list.AddElement('f'); Assert.That(list.GetElementCount(), Is.EqualTo(6)); Assert.That(list.GetElement(5), Is.EqualTo('f')); }