public void ItemIndexDecreases() { int item1 = 1; int item2 = 2; NList <int> items = new NList <int>() { item1, item2 }; items.Remove(item1); Assert.AreEqual(2, items[0]); }
public void RemoveItemFromList() { int item1 = 1; int item2 = 2; NList <int> items = new NList <int>() { item1, item2 }; items.Remove(item2); Assert.AreNotEqual(2, items[1]); }
public void ListCountDecreasesBy1() { int item1 = 1; int item2 = 2; int firstCount; int secondCount; NList <int> items = new NList <int>() { item1, item2 }; firstCount = items.Count; items.Remove(item1); secondCount = items.Count; Assert.AreEqual(1, secondCount); }
public void ListCountDecreases() { int item1 = 1; int item2 = 2; int firstCount; int secondCount; NList <int> items = new NList <int>() { item1, item2 }; firstCount = items.Count; items.Remove(item1); secondCount = items.Count; Assert.Less(secondCount, firstCount); }
public void ListCountChanges() { int item1 = 1; int item2 = 2; int firstCount; int secondCount; NList <int> items = new NList <int>() { item1, item2 }; firstCount = items.Count; items.Remove(item1); secondCount = items.Count; Assert.AreNotEqual(firstCount, secondCount); }
public void RemoveFromList() { NList <int> nums = new NList <int>() { 15, 14, 13, 1, 2, 3 }; for (int i = 0; i < 3; i++) { foreach (int num in nums) { if (nums[i] == num) { nums.Remove(i); } } } Assert.AreEqual(4, nums.Count); }
public void DeleteItem(NShoppingCartItem item, NWidgetHostingExample example) { // remove the item and rebuild the shopping cart Items.Remove(item); example.m_ShoppingCartWidget.Content = CreateWidget(example); }
/// <summary> /// <para>Returns current list without elements equal to x. /// Equals method is used to compare elements. /// /// </para> /// </summary> public list <T> Remove(T x) { return(NList.Remove <T>(this, x)); }