public void AddLast_01() { // Arrange var list = new LimitList <int>(3); // Act list.AddLast(1); list.AddLast(2); // Assert CollectionAssert.AreEquivalent(new int[] { 1, 2 }, list.ToList()); }
public void AddLast_01() { // Arrange var list = new LimitList <int>(3); // Act list.AddLast(1); list.AddLast(2); // Assert Assert.Equal(new int[] { 1, 2 }, list.ToList()); }
public void Contains_02() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); // Act var result = list.Contains(3); // Assert Assert.AreEqual(false, result); }
public void Count_01() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); // Act var count = list.Count; // Assert Assert.AreEqual(2, count); }
public void Contains_01() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); // Act var result = list.Contains(2); // Assert Assert.True(result); }
public void IndexOf_01() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); list.AddLast(3); // Act var index = list.IndexOf(2); // Assert Assert.AreEqual(1, index); }
public void Remove_01() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); // Act var result = list.Remove(1); // Assert Assert.AreEqual(true, result); Assert.AreEqual(1, list.Count); Assert.AreEqual(2, list[0]); }
public void Remove_01() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); // Act var result = list.Remove(1); // Assert Assert.True(result); Assert.Single(list); Assert.Equal(2, list[0]); }
public void RemoveAt() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); list.AddLast(3); // Act list.RemoveAt(1); // Assert Assert.AreEqual(2, list.Count); Assert.AreEqual(1, list[0]); Assert.AreEqual(3, list[1]); }
public void Remove_02() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); list.AddLast(2); list.AddLast(3); // Act var result = list.Remove(2); // Assert Assert.True(result); Assert.Equal(2, list.Count); Assert.Equal(1, list[0]); Assert.Equal(3, list[1]); }
public void Indexer_01() { // Arrange var list = new LimitList <int>(3); list.AddLast(1); // Act list[0] = 10; // Assert Assert.AreEqual(1, list.Count); Assert.AreEqual(10, list[0]); }